Gmane
From: Jeff Garland <jeff <at> crystalclearsoftware.com>
Subject: Re: [ptr_container] feature request: BOOST_PTR_CONTAINER_NO_SERIALIZATION
Newsgroups: gmane.comp.lib.boost.devel
Date: 2007-05-28 15:02:36 GMT (2 years, 5 weeks, 2 days, 4 hours and 1 minute ago)
Sebastian Ramacher wrote:
> As of version 1.34, Boost.PtrContainer supports serialization as defined
> by Boost.Serialization. Now I'd like to propose a switch to disable this
> feature. The attached patch adds checks if
> BOOST_PTR_CONTAINER_NO_SERIALZATION is defined around the serialization
> related code blocks and enables/disables serialization support.
> 
> It's not that I don't like serialization support but on a Debian system
> you have to install libboost-serialization-dev and
> libboost-serialization1.34.0 just to use Boost.PtrContainer.
> 
> The patch was created against CVS HEAD but I'd gladly provide a patch
> against 1.34 if it finds any interest.

In my view, a cleaner solution would be to move the serialization code to be 
external to the container and then optionally included.  So, for example,

   #include <boost/ptr_container/ptr_list_serialize.hpp>

would get you the serialization stuff.  I didn't look exhaustively, but it 
looks the the serialization code uses only public interfaces on the containers 
so this approach should be easy and it avoids all the #ifdef hackery.  It 
would also mean that the serialization dependency is 'off' by default and only 
gets included at the request of the user.

I've been advocating that we move to this approach as much as possible within 
boost so that there's as much consistency as possible across boost libs w.r.t. 
this issue.

Jeff

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost