From: Inconnu on 10 Mar 2010 04:50 According to the latest draft, there is no difference between direct- list-initialization and copy-list-initialization in the process of overload resolution. Besides, if there is an initializer-list- constructor in the class, the braced-init-list is considered a single argument and all constructors are candidates for overload resolution. This enables the following example to be correct. Am I right? #include <initializer_list> struct Z {}; // dummy class struct A { A (std::initializer_list<int>); }; struct B { B (std::initializer_list<Z>); // adding such constr. to every class // it is never viable B (A); }; struct C { C (std::initializer_list<Z>); C (B); }; struct B { D (std::initializer_list<Z>); D (C); }; D d {1, 2, 3}; -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
|
Pages: 1 Prev: std::search versus strstr for std::vector<char> Next: Vector of iterators? |