[odb-users] lazy_shared_ptr compilation issue
Konstantin Tarovik
konstantin.tarovik at ab-soft.net
Thu Apr 23 09:34:41 EDT 2015
Hi all,
I have the following issue with lazy_shared_ptr. In one of my persistent
objects there is a field:
odb::lazy_shared_ptr<Contact> _sender;
It compiles both with ODB compiler and C++ without issues until I call
_sender.load(). When I add this call I get the following error when
compiling my project with C++:
In file included from
external/storage/odb/ios/include/odb/lazy-ptr.hxx:668:
external/storage/odb/ios/include/odb/lazy-ptr.ixx:1153:10:
error: no viable overloaded '='
p_ = i_.template load<T> (true); // Reset id.
~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/user/Documents/Work/core/src/db/message_imp.cpp:56:21:
note: in instantiation of member function
'odb::lazy_shared_ptr<rc::core::Contact>::load' requested here
return _sender.load();
^
In file included from
/Users/user/Documents/Work/core/src/db/message_imp.cpp:9:
In file included from
/Users/user/Documents/Work/core/src/db/message_imp.hpp:11:
In file included from core/src/db/message.hpp:11:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3841:17:
note: candidate function not viable: no known conversion from
'typename object_traits<Contact>::pointer_type' (aka
'rc::core::Contact *') to 'const
std::__1::shared_ptr<rc::core::Contact>' for 1st argument
shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3850:17:
note: candidate function not viable: no known conversion from
'typename object_traits<Contact>::pointer_type' (aka
'rc::core::Contact *') to
'std::__1::shared_ptr<rc::core::Contact>' for 1st argument
shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3848:9:
note: candidate template ignored: could not match
'shared_ptr<type-parameter-0-0>' against 'rc::core::Contact *'
operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3857:9:
note: candidate template ignored: could not match
'shared_ptr<type-parameter-0-0>' against 'rc::core::Contact *'
operator=(shared_ptr<_Yp>&& __r);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3865:9:
note: candidate template ignored: could not match
'auto_ptr<type-parameter-0-0>' against 'rc::core::Contact *'
operator=(auto_ptr<_Yp>&& __r);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3884:9:
note: candidate template ignored: could not match
'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against
'rc::core::Contact *'
operator=(unique_ptr<_Yp, _Dp>&& __r);
^
1 error generated.
Am I doing something wrong?
Thank you.
Best regards,
Konstantin Tarovik
More information about the odb-users
mailing list