Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2003-11-15 01:53:19


Vladimir Prus

>class BlockFormula : public std::map<int, int> {
>public:
> int i;
> template<class Archive>
> void serialize(Archive& ar, unsigned)
> {
> ar & i;
> }
>};

what happens when "unsigned" is changed to "const unsigned int" does
this fix the problem?

>template<class Archive, class Key, class Compare, class Allocator >
>inline void serialize(
> Archive & ar,
> std::map<Key, Compare, Allocator> &t,

>I think std::map has four parameters: Key, Value, Compare and Allocator.

I think you're right- i'm making the change.

>I can't find serialization for std::pair in the latest draft. Is it possible
>to include the attached in the new version?

try boost/serialization/utility.hpp

I chose this because std::pair is found in <utility>
BTW boost/serialization/utility.hpp includes <utility> same
thing for vector, list, etc.

>Another, unrelated comment. If void_cast can't find direction transformation
>it tries intermediate types with:

> for ( it = global_registry().m_set.begin();
> it != global_registry().m_set.end();
> ++it )

>I.e. it considers *all* knows types. Is this behaviour really desired? Can't
>be just consider all transformation for the current from_type?

the set is keyed on the from-to pair. you can't get just the members
corresponding to half the key. Remember that this operation
is only done once. when a matching pair is found, its added to the
set so it doesn't have to be done again - so execution time is not
a consideration.

Robert Ramey


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