fork(4) download
  1. #include <memory>
  2.  
  3. template <typename T>
  4. class CList {
  5. private:
  6. CList(const CList& rhs) {}
  7. };
  8.  
  9. struct hoge {
  10. };
  11.  
  12. std::unique_ptr<CList<hoge> > foo()
  13. {
  14. std::unique_ptr<CList<hoge> > baz(new CList<hoge>);
  15. return baz;
  16. }
  17.  
  18. int main()
  19. {
  20. std::unique_ptr<CList<hoge> > bar = foo();
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘std::unique_ptr<CList<hoge> > foo()’:
prog.cpp:14:41: error: no matching function for call to ‘CList<hoge>::CList()’
   std::unique_ptr<CList<hoge> > baz(new CList<hoge>);
                                         ^
prog.cpp:14:41: note: candidate is:
prog.cpp:6:3: note: CList<T>::CList(const CList<T>&) [with T = hoge]
   CList(const CList& rhs) {}
   ^
prog.cpp:6:3: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty