fork(2) download
  1. #include <iterator>
  2. #include <numeric>
  3. class Example
  4. {
  5. private:
  6. int id;
  7. public:
  8. Example(int i): id(i){}
  9. };
  10.  
  11. int main() {
  12. Example e[10];
  13. std::iota(std::begin(e), std::end(e), 0);
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:17: error: no matching function for call to ‘Example::Example()’
     Example e[10];
                 ^
prog.cpp:8:3: note: candidate: Example::Example(int)
   Example(int i): id(i){}
   ^~~~~~~
prog.cpp:8:3: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:7: note: candidate: constexpr Example::Example(const Example&)
 class Example
       ^~~~~~~
prog.cpp:3:7: note:   candidate expects 1 argument, 0 provided
prog.cpp:3:7: note: candidate: constexpr Example::Example(Example&&)
prog.cpp:3:7: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty