#include <memory>
template <typename T>
class CList {
private:
CList(const CList& rhs) {}
};
struct hoge {
};
std::unique_ptr<CList<hoge> > foo()
{
std::unique_ptr<CList<hoge> > baz(new CList<hoge>);
return baz;
}
int main()
{
std::unique_ptr<CList<hoge> > bar = foo();
}
I2luY2x1ZGUgPG1lbW9yeT4KCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpjbGFzcyBDTGlzdCB7CnByaXZhdGU6CiAgQ0xpc3QoY29uc3QgQ0xpc3QmIHJocykge30KfTsKCnN0cnVjdCBob2dlIHsKfTsKCnN0ZDo6dW5pcXVlX3B0cjxDTGlzdDxob2dlPiA+IGZvbygpCnsKICBzdGQ6OnVuaXF1ZV9wdHI8Q0xpc3Q8aG9nZT4gPiBiYXoobmV3IENMaXN0PGhvZ2U+KTsKICByZXR1cm4gYmF6Owp9CgppbnQgbWFpbigpCnsKICBzdGQ6OnVuaXF1ZV9wdHI8Q0xpc3Q8aG9nZT4gPiBiYXIgPSBmb28oKTsKfQo=
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