Now I have a function in C++
void F( std::array<int,3> x )
{
//...
}
I hope the argument 'x' could have a default value, how can I do this?
If not a function argument, I can simply use
std::array<int,3> x = {1,2,3};
But for a function argument, the code
void F( std::array<int,3> x = {1,2,3} )
{
//...
}
will make compiler error.
I test in MSVC 2012, and got error C2143, C2059, C2447. And also error in g++ 4.6.3
Is there any way make it has a default value?
thanks.