diff options
Diffstat (limited to 'boost/serialization/nvp.hpp')
-rw-r--r-- | boost/serialization/nvp.hpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/boost/serialization/nvp.hpp b/boost/serialization/nvp.hpp index 6a1eb82656..4e2297b3cc 100644 --- a/boost/serialization/nvp.hpp +++ b/boost/serialization/nvp.hpp @@ -21,9 +21,6 @@ #include <boost/config.hpp> #include <boost/detail/workaround.hpp> -#include <boost/mpl/integral_c.hpp> -#include <boost/mpl/integral_c_tag.hpp> - #include <boost/serialization/level.hpp> #include <boost/serialization/tracking.hpp> #include <boost/serialization/split_member.hpp> @@ -39,14 +36,14 @@ struct nvp : public std::pair<const char *, T *>, public wrapper_traits<const nvp< T > > { +//private: + nvp(const nvp & rhs) : + std::pair<const char *, T *>(rhs.first, rhs.second) + {} +public: explicit nvp(const char * name_, T & t) : - // note: redundant cast works around borland issue // note: added _ to suppress useless gcc warning - std::pair<const char *, T *>(name_, (T*)(& t)) - {} - nvp(const nvp & rhs) : - // note: redundant cast works around borland issue - std::pair<const char *, T *>(rhs.first, (T*)rhs.second) + std::pair<const char *, T *>(name_, & t) {} const char * name() const { @@ -60,26 +57,18 @@ struct nvp : return *(this->second); } - // True64 compiler complains with a warning about the use of - // the name "Archive" hiding some higher level usage. I'm sure this - // is an error but I want to accomodated as it generates a long warning - // listing and might be related to a lot of test failures. - // default treatment for name-value pairs. The name is - // just discarded and only the value is serialized. - template<class Archivex> + template<class Archive> void save( - Archivex & ar, + Archive & ar, const unsigned int /* file_version */ ) const { - // CodeWarrior 8.x can't seem to resolve the << op for a rhs of "const T *" ar.operator<<(const_value()); } - template<class Archivex> + template<class Archive> void load( - Archivex & ar, + Archive & ar, const unsigned int /* file_version */ ){ - // CodeWarrior 8.x can't seem to resolve the >> op for a rhs of "const T *" ar.operator>>(value()); } BOOST_SERIALIZATION_SPLIT_MEMBER() @@ -115,7 +104,6 @@ struct tracking_level<nvp< T > > BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value); }; - } // seralization } // boost |