I have a function,
void test( vector<int>& vec );
How can I set the default argument for vec ? I have tried
void test( vector<int>& vec = vector<int>() );
But there's a warning "nonstandard extension used : 'default argument' : conversion from 'std::vector<_Ty>' to 'std::vector<_Ty> &'"
Is there a better way to do this ? Instead of
void test() {
vector<int> dummy;
test( dummy );
}
Regards, Voteforpedro