fork(1) download
  1. #include <memory>
  2. #include <vector>
  3.  
  4. template <typename T>
  5. struct holder
  6. {
  7. holder() = default;
  8.  
  9. holder(const holder& b)
  10. : t(b.t)
  11. {
  12. }
  13.  
  14. holder(holder&& b) = delete;
  15.  
  16. holder& operator=(const holder& b)
  17. {
  18. t = b.t;
  19. return *this;
  20. }
  21.  
  22. holder& operator=(holder&& b) = delete;
  23.  
  24. T t;
  25. };
  26.  
  27. typedef holder<std::unique_ptr<int>> ptr;
  28.  
  29. typedef std::vector<ptr> vec;
  30.  
  31. typedef vec test_t;
  32.  
  33. test_t foo();
  34.  
  35. int main()
  36. {
  37. test_t x = foo();
  38. x = foo();
  39. return 0;
  40. }
  41.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/Yyouzx/ccjJRAta.o: In function `main':
prog.cpp:(.text.startup+0x1b): undefined reference to `foo()'
prog.cpp:(.text.startup+0x21): undefined reference to `foo()'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty