I have the following example:
struct S{
int x, y;
}
S s1{1}; // direct-initialization or direct-list-initialization ?
S s2{1, 2}; // direct-initialization or direct-list-initialization ?
S s3(1); // direct-initialization or direct-list-initialization ?
S s4(1, 2); // direct-initialization or direct-list-initialization ?
int i1{10}; // direct-initialization or direct-list-initialization ?
int i2(10); // direct-initialization or direct-list-initialization ?
My questions
- I just need to know what's the type of initialization in the above statements?
- Is there any standard quote applied here?
I am already checked the question direct-initialization vs direct-list-initialization (C++), but it hasn't strict answer yet.
From direct initialization's documentation:
And from List initialization:
Direct-list-initialization
Now we can use the above to answer your question.