|
Boost-Commit : |
From: ramey_at_[hidden]
Date: 2007-12-24 19:07:57
Author: ramey
Date: 2007-12-24 19:07:56 EST (Mon, 24 Dec 2007)
New Revision: 42280
URL: http://svn.boost.org/trac/boost/changeset/42280
Log:
Adjustments for trak tickets - ready for upload as version 1.36.0
Added:
branches/serialization_next_release/boost/boost/serialization/complex.hpp
- copied, changed from r42264, /trunk/boost/serialization/complex.hpp
branches/serialization_next_release/boost/boost/serialization/is_bitwise_serializable.hpp
- copied unchanged from r42264, /trunk/boost/serialization/is_bitwise_serializable.hpp
Text files modified:
branches/serialization_next_release/boost/boost/serialization/complex.hpp | 74 +++++++++++++++++++++++++++------------
branches/serialization_next_release/boost/boost/serialization/export.hpp | 10 +++--
branches/serialization_next_release/boost/boost/serialization/utility.hpp | 12 ++++++
3 files changed, 69 insertions(+), 27 deletions(-)
Copied: branches/serialization_next_release/boost/boost/serialization/complex.hpp (from r42264, /trunk/boost/serialization/complex.hpp)
==============================================================================
--- /trunk/boost/serialization/complex.hpp (original)
+++ branches/serialization_next_release/boost/boost/serialization/complex.hpp 2007-12-24 19:07:56 EST (Mon, 24 Dec 2007)
@@ -28,55 +28,83 @@
template<class Archive, class T>
-inline void serialize(
+ inline void serialize(
Archive & ar,
std::complex<T> & t,
const unsigned int file_version
-)
+ )
{
- boost::serialization::split_free(ar, t, file_version);
+ boost::serialization::split_free(ar, t, file_version);
}
-template<class Archive, class T>
-inline void save(
+template<class Archive>
+ inline void save(
Archive & ar,
- std::complex<T> const& x,
+ std::complex<float> const& x,
const unsigned int /* file_version */
-)
+ )
{
- double re=x.real();
- double im=x.imag();
- ar << boost::serialization::make_nvp("real", re);
- ar << boost::serialization::make_nvp("imag", im);
+ float re = x.real();
+ float im = x.imag();
+ ar << boost::serialization::make_nvp("real", re);
+ ar << boost::serialization::make_nvp("imag", im);
}
-template<class Archive, class T>
-inline void load(
+template<class Archive>
+ inline void save(
+ Archive & ar,
+ std::complex<double> const& x,
+ const unsigned int /* file_version */
+ )
+{
+ double re = x.real();;
+ double im = x.imag();
+ ar << boost::serialization::make_nvp("real", re);
+ ar << boost::serialization::make_nvp("imag", im);
+}
+
+template<class Archive>
+ inline void load(
Archive & ar,
- std::complex<T>& x,
+ std::complex<float>& x,
const unsigned int /* file_version */
-)
+ )
{
- double re;
- double im;
- ar >> boost::serialization::make_nvp("real", re);
- ar >> boost::serialization::make_nvp("imag", im);
- x = std::complex<T>(re,im);
+ float re;
+ float im;
+ ar >> boost::serialization::make_nvp("real", re);
+ ar >> boost::serialization::make_nvp("imag", im);
+ x = std::complex<float>(re,im);
}
+template<class Archive>
+ inline void load(
+ Archive & ar,
+ std::complex<double>& x,
+ const unsigned int /* file_version */
+ )
+{
+ double re;
+ double im;
+ ar >> boost::serialization::make_nvp("real", re);
+ ar >> boost::serialization::make_nvp("imag", im);
+ x = std::complex<double>(re,im);
+}
+
+
/// specialization of serialization traits for complex
template <class T>
struct is_bitwise_serializable<std::complex<T> >
- : public is_bitwise_serializable<T> {};
+ : public is_bitwise_serializable<T> {};
template <class T>
struct implementation_level<std::complex<T> >
- : mpl::int_<object_serializable> {} ;
+ : mpl::int_<object_serializable> {} ;
// treat complex just like builtin arithmetic types for tracking
template <class T>
struct tracking_level<std::complex<T> >
- : mpl::int_<track_never> {} ;
+ : mpl::int_<track_never> {} ;
} // serialization
} // namespace boost
Modified: branches/serialization_next_release/boost/boost/serialization/export.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/serialization/export.hpp (original)
+++ branches/serialization_next_release/boost/boost/serialization/export.hpp 2007-12-24 19:07:56 EST (Mon, 24 Dec 2007)
@@ -154,7 +154,7 @@
BOOST_PP_CAT(boost_serialization_guid_initializer_, __LINE__) \
= ::boost::serialization::singleton< \
::boost::archive::detail::guid_initializer< T > \
- >::get_mutable_instance().export_guid(K); \
+ >::get_mutable_instance().export_guid(K); \
}
// the following is solely to support de-serialization of pointers serialized
@@ -163,10 +163,12 @@
namespace \
{ \
::boost::archive::detail::guid_initializer< T > const & \
- BOOST_PP_CAT(boost_serialization_guid_initializer_, __LINE__ ## _1) \
- = ::boost::serialization::singleton< \
+ BOOST_PP_CAT( \
+ boost_serialization_guid_initializer_, \
+ BOOST_PP_CAT(__LINE__,_1) \
+ ) = ::boost::serialization::singleton< \
::boost::archive::detail::guid_initializer< T > \
- >::get_mutable_instance().export_guid(K); \
+ >::get_mutable_instance().export_guid(K); \
}
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
Modified: branches/serialization_next_release/boost/boost/serialization/utility.hpp
==============================================================================
--- branches/serialization_next_release/boost/boost/serialization/utility.hpp (original)
+++ branches/serialization_next_release/boost/boost/serialization/utility.hpp 2007-12-24 19:07:56 EST (Mon, 24 Dec 2007)
@@ -22,6 +22,7 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/is_bitwise_serializable.hpp>
namespace boost {
namespace serialization {
@@ -41,6 +42,17 @@
ar & boost::serialization::make_nvp("second", p.second);
}
+/// specialization of is_bitwise_serializable for pairs
+template <class T, class U>
+struct is_bitwise_serializable<std::pair<T,U> >
+ : public mpl::and_<is_bitwise_serializable<T>,is_bitwise_serializable<U> >
+{
+};
+
+template <class T, class U>
+struct implementation_level<std::pair<T,U> >
+ : mpl::int_<object_serializable> {} ;
+
} // serialization
} // namespace boost
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk