Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 7 years ago

Language

Compiler

Options

Author

anonymous

almost 7 years ago

$
prog.cc:20:15: error: non-const lvalue reference to type 'unique_ptr<...>' cannot bind to a temporary of type 'unique_ptr<...>'
            : item(std::move(t))
              ^    ~~~~~~~~~~~~
prog.cc:15:12: note: in instantiation of member function 'foo(std::__1::unique_ptr<x, std::__1::default_delete<x> > &&)::boo::boo' requested here
    struct boo 
           ^
prog.cc:31:5: note: in instantiation of function template specialization 'foo<std::__1::unique_ptr<x, std::__1::default_delete<x> > &>' requested here
    foo(b);
    ^
prog.cc:24:9: error: no matching constructor for initialization of 'boo'
    new boo(std::move(item));
        ^   ~~~~~~~~~~~~~~~
prog.cc:31:5: note: in instantiation of function template specialization 'foo<std::__1::unique_ptr<x, std::__1::default_delete<x> > &>' requested here
    foo(b);
    ^
prog.cc:15:12: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'typename remove_reference<unique_ptr<x, default_delete<x> > &>::type' (aka 'std::__1::unique_ptr<x, std::__1::default_delete<x> >') to 'const boo' for 1st argument
    struct boo 
           ^
prog.cc:15:12: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'typename remove_reference<unique_ptr<x, default_delete<x> > &>::type' (aka 'std::__1::unique_ptr<x, std::__1::default_delete<x> >') to 'boo' for 1st argument
    struct boo 
           ^
2 errors generated.
Exit Code:
1