[odb-users] Passing persistence object to smart pointer

Boris Kolpackov boris at codesynthesis.com
Wed Mar 2 08:45:11 EST 2011


In the future please keep your replies CC'ed to the odb-users mailing
list as discussed in the posting guidelines:


Bright Dadson <losintikfos at yahoo.co.uk> writes:

> Is it possible to use boost::shared_ptr instead of std::auto_ptr as
> the --default-pointer defintion for odb? if so, how do I pass 
> boost::shared_ptr as param to the odb codegen.

Not at the moment, but we are working on the ODB profile for Boost
which will allow this quite easily. We plan to release this in the
next week or two.

In the meantime, you can use std::tr1::shared_ptr (which has the
Boost shared_ptr interface). To do this, simply add the following
option to the ODB command line:

--default-pointer std::tr1::shared_ptr

And use std::tr1::shared_ptr instead of boost::shared_ptr in your


More information about the odb-users mailing list