Quick question:
Normally when I have a function, I can make one or more of the 'last' arguments as defaults, for example:
string whatever( int a, string b="NONE" )
{
//blah, blah, blah
string temp= "WHATEVER";
return temp;
}
The benefit is that I can have one function and I can do logic in there based on whether my parameter has the default or has something else.
I would like to do the same thing, but with a parameter that is a container. How do I do it?
string whateverTwo( int a, vector<string> defaultV = ????)
{
//whatever
string temp= "WHATEVER";
return temp;
}
I want this so that I can either pass in the vector or not. I know that I of course can make 2 different functions, but wanted to see if I could do a default instead. Any thoughts?