|
Boost : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2005-08-28 10:28:18
On Fri, 26 Aug 2005 17:32:51 -0400, Neal Becker wrote
> Thanks. I believe I have this OK now, but it was _much_ harder than
> it should have been, because the only documentation is wrong.
>
> I tried to follow the example here:
> http://boost.org/libs/serialization/doc/traits.html#templates
>
> But it looks like the correct implementation is this:
> namespace boost {
> namespace serialization {
>
> template<class T>
> struct implementation_level<std::complex<T> >
> {
> // typedef mpl::int_<object_serializable> type;
> typedef mpl::integral_c_tag tag;
> typedef mpl::int_<primitive_type> type;
> BOOST_STATIC_CONSTANT(
> int,
> value = implementation_level::type::value
> );
> };
>
> // // nvp objects are generally created on the stack and are never tracked
> template<class T>
> struct tracking_level<std::complex<T> >
> {
> typedef mpl::integral_c_tag tag;
> typedef mpl::int_<track_never> type;
> BOOST_STATIC_CONSTANT(
> int,
> value = tracking_level::type::value
> );
> BOOST_STATIC_ASSERT((
> mpl::greater<
> /* that is a prmitive */
> implementation_level< T >,
> mpl::int_<primitive_type>
> >::value
> ));
> };
>
> }
> }
> This is what I found in level.hpp and tracking.hpp
>
...catching up on thread...
Somehow I completely missed these flags when implementing the date-time
serialization capabilities. Seems like the date-time classes should be set to
primitive_types. But if I did this now, I'm going to break existing archives
-- right?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk