fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <memory>
  5. #include <map>
  6. #include <unordered_map>
  7.  
  8. using namespace std;
  9.  
  10. struct ptrwrap
  11. {
  12. unique_ptr<int> foo;
  13. };
  14.  
  15. template <typename T>
  16. struct holder
  17. {
  18. holder() = default;
  19.  
  20. holder(const holder& b)
  21. : t(b.t)
  22. {
  23. }
  24.  
  25. holder(holder&& b)
  26. : t(std::move(b.t))
  27. {
  28. }
  29.  
  30. holder& operator=(const holder& h)
  31. {
  32. t = h.t;
  33. return *this;
  34. }
  35.  
  36. holder& operator=(holder&& h)
  37. {
  38. t = std::move(h.t);
  39. return *this;
  40. }
  41.  
  42. T t;
  43. };
  44.  
  45. struct y_u_no_elision
  46. {
  47. holder<ptrwrap> elem;
  48. };
  49.  
  50. typedef unordered_map<std::string, y_u_no_elision> mymap;
  51.  
  52. mymap foo();
  53.  
  54. int main()
  55. {
  56. auto m = foo();
  57. m = foo();
  58. return 0;
  59. }
  60.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/9vauFj/ccmbTRZb.o: In function `main':
prog.cpp:(.text.startup+0x1c): undefined reference to `foo()'
prog.cpp:(.text.startup+0x22): undefined reference to `foo()'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty