#include <initializer_list> class A {public: A(const A&nocopy) = delete; A&operator=(const A&nocopy) = delete; A(const std::initializer_list<int>& rhs) {}}; int main() { A a{ 2, 3, 5, 7}; A b( { 2, 3, 5, 7} ); A c = { 2, 3, 5, 7}; A d = A{ 2, 3, 5, 7};}
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:5:4: error: deleted function 'A::A(const A&)' prog.cpp:13:23: error: used here prog.cpp:5:4: error: deleted function 'A::A(const A&)' prog.cpp:14:24: error: used here
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!