[odb-users] Embed operator==(const DBO& other) yields compilation error when using odb::lazy_shared_ptr

Boris Kolpackov boris at codesynthesis.com
Wed Sep 20 18:38:03 EDT 2017

Vassilios Kountouriotis <b.kountouriotis at gmail.com> writes:
> /usr/libexec/odb/x86_64-linux-gnu/include/odb/lazy-ptr.ixx:1153:
> error: no match for ‘operator=’ (operand types are
> ‘std::shared_ptr<DB_GameType>’ and
> ‘odb::object_traits<DB_GameType>::pointer_type {aka DB_GameType*}’)
>        p_ = i_.template load<T> (true); // Reset id.
>           ^
> It seems like it ignores the shared_ptr pointer type.

Try to move operator==() to the source file after including the
*-odb header for DB_GameType (load() needs to "see" the traits
type for DB_GameType that is defined in this header).


More information about the odb-users mailing list