Till now I have only seen the assignment initialization for POD arrays in C++. For instance,
int array[]={1,2,3};
From here I learned that it is possible to initialize an array using the initialization list approach when it is inside a class/struct in C++11. But I tried to define the array like:
int array[]({1,2,3});
An error occurred when compiling:
array initializer must be an initializer list
I think it only needs a few modifications but I just cannot figure out. Could you please tell me how can I achieve it?
BTW, is the copy constructor more efficient than the assignment one here? I guess not, but I don't know the exactly answer.