fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <memory>
  4. #include <vector>
  5. #include <cassert>
  6. using namespace std;
  7. class Team{};
  8. class Employee{};
  9.  
  10. int main() {
  11. std::map<std::unique_ptr<Team>, std::unique_ptr<std::vector<std::unique_ptr<Employee>>>> teams;
  12. teams [make_unique<Team>()] = make_unique<vector<unique_ptr<Employee>>>();
  13.  
  14. auto team2 = make_unique<Team>();
  15. teams [std::move(team2)] = make_unique<vector<unique_ptr<Employee>>>();
  16. assert (team2, "ouch");
  17.  
  18. return 0;
  19. }
Compilation error #stdin compilation error #stdout 0s 15240KB
stdin
Standard input is empty
compilation info
prog.cpp:16:23: error: macro "assert" passed 2 arguments, but takes just 1
  assert (team2, "ouch");
                       ^
prog.cpp: In function ‘int main()’:
prog.cpp:16:2: error: ‘assert’ was not declared in this scope
  assert (team2, "ouch");
  ^~~~~~
stdout
Standard output is empty