Does C++ have a way to pass in the default parameter without specifying it? Example:
If I use debug_log_error("Hi", 2) it will use the true there for parameter 3, but if I later change my function definition to use false for the lLogAlways parameter, then unless I remember to change my debug_log_error #define as well, it will now be stale and out of sync.
If I could leave the parameter blank, or use an @ there (or something), to tell the compiler to fill it in with the default value ... that would be what's needed.
Is there a way?
--
Rick C. Hodgin
Code:
bool debug_log(char* text, int length, bool lLogAlways = true, SRgb* backColor = NULL, SRgb* foreColor = NULL);
#define debug_log_error(a, b) debug_log(a, b, true, &redColor, &whiteColor)
If I use debug_log_error("Hi", 2) it will use the true there for parameter 3, but if I later change my function definition to use false for the lLogAlways parameter, then unless I remember to change my debug_log_error #define as well, it will now be stale and out of sync.
If I could leave the parameter blank, or use an @ there (or something), to tell the compiler to fill it in with the default value ... that would be what's needed.
Is there a way?
--
Rick C. Hodgin