Does the signature of a function declaration has to match the signature of the function definition?
Show answer and explanation
Declarations for the same function must agree on parameter types and function qualifiers; otherwise they denote a different overload or fail to match a definition. Return type alone cannot distinguish overloads, while default arguments are not part of the function type.
Declarations for the same function must agree on parameter types and function qualifiers; otherwise they denote a different overload or fail to match a definition. Return type alone cannot distinguish overloads, while default arguments are not part of the function type.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.