Setting method parameter defaults seems like a tidy way to make a method more usable. However, function pointers to methods with defaulted parameters can be confusing, because the function signature may not seem to match the call signature. Therefore, the use of multiple, overloaded methods is preferred.


== Noncompliant Code Example

----
void HelloWorld (string name="World")
{
    cout << "Hello " << name << endl;
}
----


== Compliant Solution

----
void HelloWorld (string name)
{
    cout << "Hello " << name << endl;
}

void HelloWorld ()
{
    HelloWorld("World");
}
----

=== See Also

* S3719



ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
