In C++, how do I declare a function that has an optional parameter?
I searched the knowledge base and was not able to find anything about optional parameters.
Does setting the default value of the parameter in the function declaration automatically make it optional?
void MyFunction(const std::string& parameter1, const std::string& parameter2);
I need to make parameter2 optional and default it to parameter1.
I searched the knowledge base and was not able to find anything about optional parameters.
Does setting the default value of the parameter in the function declaration automatically make it optional?
void MyFunction(const std::string& parameter1, const std::string& parameter2);
I need to make parameter2 optional and default it to parameter1.