class P {
public:
explicit P( int a, int b, int c) {
std::cout<<"calling explicit constructor"<<"\n";
}
};
int main() {
P z {77,5,42}; // OK
P w = {77,5,42}; // ERROR due to explicit (no implicit type conversion allowed)
}
I think {77,5,42}
has the implicit type of std::initialization_list<int>
. If that is the case what is not causing the failure of construction of variable z
?