fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5.  
  6. struct test {
  7. const int index;
  8. private:
  9. test(const test&) = delete; // comment out this line and voila.
  10. };
  11.  
  12. int main(int argc, char** argv) {
  13. test arg = {1};
  14. return arg.index;
  15. }
Compilation error #stdin compilation error #stdout 0s 3476KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main(int, char**)’:
prog.cpp:13:16: error: could not convert ‘{1}’ from ‘<brace-enclosed initializer list>’ to ‘test’
   test arg = {1};
                ^
stdout
Standard output is empty