Boost logo

Boost :

From: Vyacheslav E. Andrejev (vandrejev_at_[hidden])
Date: 2004-10-22 04:10:16


Hello,

Using BOOST_CLASS_IMPLEMENTATION there is no way to assign specific
serialization implementation to any specialization of some template class.
Suppose we have template class

    template <class Params>
    class LaserPointSerializationExpression
    {
     ...
    };
And we want that any specialization of this class should be
object_serializable. Simple use of

BOOST_CLASS_IMPLEMENTATION(LaserPointSerializationExpression,
boost::serialization::object_serializable);

will give us the following code
namespace boost {
  namespace serialization {
    template <>
    struct implementation_level<LaserPointSerializationExpression >
    {
      typedef mpl::integral_c_tag tag;
      typedef mpl::int_< boost::serialization::object_serializable > type;
      static const int value = implementation_level::type::value;
    };
  }
}
which obviously will fail to compile. The correct code is
namespace boost {
  namespace serialization {
    template <class Params>
    struct
implementation_level<asda::lpfio::LaserPointSerializationExpression<Params>
>
    {
      typedef mpl::integral_c_tag tag;
      typedef mpl::int_< boost::serialization::object_serializable > type;
      static const int value = implementation_level::type::value;
    };
  }
}
But there's no macro such as BOOST_CLASS_IMPLEMENTATION to generate it. So I
think there should be special version of BOOST_CLASS_IMPLEMENTATION that
allows to generate implementation_level for any specialization of some
template.

-- 
______________________________
Vyacheslav E. Andrejev
System Architect, Excelsior, LLC
E-mail: vandrejev_at_[hidden]
ICQ: 7152604

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk