Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 8 years ago

Language

Compiler

Options

Author

anonymous

about 8 years ago

$
prog.cc: In function 'int main()':
prog.cc:30:17: error: no matching function for call to 'std::shared_ptr<Widget>::reset(std::shared_ptr<Widget>&)'
     pw2.reset(pw); // this does not work
                 ^
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr.h:52:0,
                 from /opt/wandbox/gcc-head/include/c++/8.0.0/memory:81,
                 from prog.cc:3:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1266:7: note: candidate: 'void std::__shared_ptr<_Tp, _Lp>::reset() [with _Tp = Widget; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
       reset() noexcept
       ^~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1266:7: note:   candidate expects 0 arguments, 1 provided
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1271:2: note: candidate: 'template<class _Yp> std::__shared_ptr<_Tp, _Lp>::_SafeConv<_Yp> std::__shared_ptr<_Tp, _Lp>::reset(_Yp*) [with _Yp = _Yp; _Tp = Widget; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
  reset(_Yp* __p) // _Yp must be complete.
  ^~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1271:2: note:   template argument deduction/substitution failed:
prog.cc:30:17: note:   mismatched types '_Yp*' and 'std::shared_ptr<Widget>'
     pw2.reset(pw); // this does not work
                 ^
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr.h:52:0,
                 from /opt/wandbox/gcc-head/include/c++/8.0.0/memory:81,
                 from prog.cc:3:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1280:2: note: candidate: 'template<class _Yp, class _Deleter> std::__shared_ptr<_Tp, _Lp>::_SafeConv<_Yp> std::__shared_ptr<_Tp, _Lp>::reset(_Yp*, _Deleter) [with _Yp = _Yp; _Deleter = _Deleter; _Tp = Widget; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
  reset(_Yp* __p, _Deleter __d)
  ^~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1280:2: note:   template argument deduction/substitution failed:
prog.cc:30:17: note:   mismatched types '_Yp*' and 'std::shared_ptr<Widget>'
     pw2.reset(pw); // this does not work
                 ^
In file included from /opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr.h:52:0,
                 from /opt/wandbox/gcc-head/include/c++/8.0.0/memory:81,
                 from prog.cc:3:
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1285:2: note: candidate: 'template<class _Yp, class _Deleter, class _Alloc> std::__shared_ptr<_Tp, _Lp>::_SafeConv<_Yp> std::__shared_ptr<_Tp, _Lp>::reset(_Yp*, _Deleter, _Alloc) [with _Yp = _Yp; _Deleter = _Deleter; _Alloc = _Alloc; _Tp = Widget; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2]'
  reset(_Yp* __p, _Deleter __d, _Alloc __a)
  ^~~~~
/opt/wandbox/gcc-head/include/c++/8.0.0/bits/shared_ptr_base.h:1285:2: note:   template argument deduction/substitution failed:
prog.cc:30:17: note:   mismatched types '_Yp*' and 'std::shared_ptr<Widget>'
     pw2.reset(pw); // this does not work
                 ^
Exit Code:
1