I now have a function in C ++
void F( std::array<int,3> x ) {
I hope the argument "x" can 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 the function argument, the code
void F( std::array<int,3> x = {1,2,3} ) {
will make a compiler error.
I am testing in MSVC 2012 and received error C2143, C2059, C2447. And also a bug in g ++ 4.6.3
Is there any way to make this the default?
thanks.
source share