[odb-users] Create New Object

Boris Kolpackov boris at codesynthesis.com
Mon Jun 24 08:24:19 EDT 2013


Hi Tarik,

Tarik BENZ <tenchu.tarik at hotmail.fr> writes:

> error C2679: binary '=' : no operator found which takes a right-hand
> operand of type 'Foo *' (or there is no acceptable conversion) lazy-ptr.ixx

Which line does the error point to? You need to *always* provide this
information! I keep telling you to include all the relevant information
in your emails and you keep ignoring me. Next time you ask a question
that doesn't include everything -- I am ignore you.


> this is how I use it :
> 
> const std::shared_ptr<Foo> getRefFoo() const
>     {
>         return this->currentObject->getRefFoo().load();
>     }
> 
> const odb::lazy_shared_ptr<Foo> getRefFoo() const
>     {
>         return this->ref_Foo;
>     }

This doesn't make any sense to me. Is the first function calling
the second? If that's the case, then perhaps it doesn't work
because load() is not const?

Generally, it is a bad idea to call load() in accessors since
it can only be called within a transaction.

Boris



More information about the odb-users mailing list