[odb-users] Create New Object

Tarik BENZ tenchu.tarik at hotmail.fr
Mon Jun 24 08:33:18 EDT 2013


Line 1132

> Date: Mon, 24 Jun 2013 14:24:19 +0200
> From: boris at codesynthesis.com
> To: tenchu.tarik at hotmail.fr
> CC: odb-users at codesynthesis.com
> Subject: Re: [odb-users] Create New Object
> 
> 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