我不明白为什么可以这样做:
int numbers[] = {-4,3,0,100,2000};
Set d(5,numbers);
但是尝试执行此操作时出现以下错误:
Set d(5,{-4,3,0,100,2000});
Error:
warning: extended initializer lists only available with -std=c++0x
or -std=gnu++0x|
error: no matching function for call to
'Set::Set(int, <brace-enclosed initializer list>)'
构造函数:
Set::Set(int size, const int constSet[])
谢谢你的帮助