/*! * \file bitset.hpp * \brief Provides Boost.Serialization support for std::bitset * \author Brian Ravnsgaard Riis * \author Kenneth Riddile * \date 16.09.2004, updated 04.03.2009 * \copyright 2004 Brian Ravnsgaard Riis * \license Boost Software License 1.0 */ #ifndef BOOST_SERIALIZATION_BITSET_HPP #define BOOST_SERIALIZATION_BITSET_HPP #include #include #include #include #include #include #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #define STD _STLP_STD #else #define STD std #endif #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP namespace boost { namespace serialization { #else namespace STD { #endif template inline void save(Archive & ar, STD::bitset const & t, const unsigned int version) { std::string bits = t.to_string(); ar << BOOST_SERIALIZATION_NVP( bits ); } template inline void load(Archive & ar, STD::bitset & t, const unsigned int version) { std::string bits; ar >> BOOST_SERIALIZATION_NVP( bits ); t._Construct( bits, 0, size, '0' ); } template inline void serialize(Archive & ar, STD::bitset & t, const unsigned int version) { boost::serialization::split_free( ar, t, version ); } #ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP } // namespace STD #else } // namespace serialization } // namespace boost #endif #endif // BOOST_SERIALIZATION_BITSET_HPP