I believe the problem lies in the fact that you only have 1 paramater in your function. From functions I have seen you need to have at least one paramater that does not have a default paramater
NathanOliver
Posting Virtuoso
1,515 posts since Apr 2009
Reputation Points: 281
Solved Threads: 277
Skill Endorsements: 3
void foo(string & s = "default");
Make it a const reference:
void foo(string const& s = "default");
It's really no different from just calling a function taking a reference with a string literal:
#include <string>
using namespace std;
void foo(string&) {}
int main()
{
foo("test"); // Error, "test" is an rvalue
}
deceptikon
Challenge Accepted
3,445 posts since Jan 2012
Reputation Points: 822
Solved Threads: 473
Skill Endorsements: 57