Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58150 - branches/release/boost/serialization
From: ramey_at_[hidden]
Date: 2009-12-05 01:32:50


Author: ramey
Date: 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
New Revision: 58150
URL: http://svn.boost.org/trac/boost/changeset/58150

Log:
Merge changes to release branch
Properties modified:
   branches/release/boost/serialization/ (props changed)
Text files modified:
   branches/release/boost/serialization/access.hpp | 9 +++++++++
   branches/release/boost/serialization/array.hpp | 34 +++++++++++++++++++++-------------
   branches/release/boost/serialization/binary_object.hpp | 9 +++++++--
   branches/release/boost/serialization/collections_save_imp.hpp | 2 +-
   branches/release/boost/serialization/extended_type_info_no_rtti.hpp | 2 +-
   branches/release/boost/serialization/extended_type_info_typeid.hpp | 3 ++-
   branches/release/boost/serialization/shared_ptr.hpp | 23 +++++++++++++++++++----
   branches/release/boost/serialization/singleton.hpp | 13 ++++++++++++-
   branches/release/boost/serialization/slist.hpp | 2 +-
   branches/release/boost/serialization/static_warning.hpp | 12 ++++++------
   branches/release/boost/serialization/variant.hpp | 4 +++-
   branches/release/boost/serialization/void_cast.hpp | 13 +++++++++++--
   12 files changed, 93 insertions(+), 33 deletions(-)

Modified: branches/release/boost/serialization/access.hpp
==============================================================================
--- branches/release/boost/serialization/access.hpp (original)
+++ branches/release/boost/serialization/access.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -106,6 +106,15 @@
         T & t,
         const unsigned int file_version
     ){
+ // note: if you get a compile time error here with a
+ // message something like:
+ // cannot convert parameter 1 from <file type 1> to <file type 2 &>
+ // a likely possible cause is that the class T contains a
+ // serialize function - but that serialize function isn't
+ // a template and corresponds to a file type different than
+ // the class Archive. To resolve this, don't include an
+ // archive type other than that for which the serialization
+ // function is defined!!!
         t.serialize(ar, file_version);
     }
     template<class T>

Modified: branches/release/boost/serialization/array.hpp
==============================================================================
--- branches/release/boost/serialization/array.hpp (original)
+++ branches/release/boost/serialization/array.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -6,16 +6,7 @@
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/serialization/nvp.hpp>
-#include <boost/serialization/split_member.hpp>
-#include <boost/serialization/wrapper.hpp>
-#include <boost/mpl/always.hpp>
-#include <boost/mpl/apply.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/type_traits/remove_const.hpp>
-#include <boost/array.hpp>
 #include <iostream>
-
 #include <cstddef> // std::size_t
 #include <cstddef>
 #include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
@@ -25,6 +16,15 @@
 } // namespace std
 #endif
 
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/wrapper.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/array.hpp>
+
 namespace boost { namespace serialization {
 
 // traits to specify whether to use an optimized array serialization
@@ -42,8 +42,8 @@
 #endif
 
 template<class T>
-class array
- : public wrapper_traits<const array<T> >
+class array :
+ public wrapper_traits<const array<T> >
 {
 public:
     typedef T value_type;
@@ -52,7 +52,15 @@
         m_t(t),
         m_element_count(s)
     {}
-
+ array(const array & rhs) :
+ m_t(rhs.m_t),
+ m_element_count(rhs.m_element_count)
+ {}
+ array & operator=(const array & rhs){
+ m_t = rhs.m_t;
+ m_element_count = rhs.m_element_count;
+ }
+
     // default implementation
     template<class Archive>
     void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const
@@ -108,7 +116,7 @@
     
 private:
     value_type* m_t;
- std::size_t const m_element_count;
+ std::size_t m_element_count;
 };
 
 template<class T>

Modified: branches/release/boost/serialization/binary_object.hpp
==============================================================================
--- branches/release/boost/serialization/binary_object.hpp (original)
+++ branches/release/boost/serialization/binary_object.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -39,8 +39,8 @@
 struct binary_object :
     public wrapper_traits<nvp<const binary_object> >
 {
- /* const */ void * const m_t;
- const std::size_t m_size;
+ void const * m_t;
+ std::size_t m_size;
     template<class Archive>
     void save(Archive & ar, const unsigned int /* file_version */) const {
         ar.save_binary(m_t, m_size);
@@ -50,6 +50,11 @@
         ar.load_binary(const_cast<void *>(m_t), m_size);
     }
     BOOST_SERIALIZATION_SPLIT_MEMBER()
+ binary_object & operator=(const binary_object & rhs) {
+ m_t = rhs.m_t;
+ m_size = rhs.m_size;
+ return *this;
+ }
     binary_object(/* const */ void * const t, std::size_t size) :
         m_t(t),
         m_size(size)

Modified: branches/release/boost/serialization/collections_save_imp.hpp
==============================================================================
--- branches/release/boost/serialization/collections_save_imp.hpp (original)
+++ branches/release/boost/serialization/collections_save_imp.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -47,7 +47,7 @@
         ar << BOOST_SERIALIZATION_NVP(item_version);
     }
     BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin();
- std::size_t c=count;
+ collection_size_type c=count;
     while(c-- > 0){
             // note borland emits a no-op without the explicit namespace
             boost::serialization::save_construct_data_adl(

Modified: branches/release/boost/serialization/extended_type_info_no_rtti.hpp
==============================================================================
--- branches/release/boost/serialization/extended_type_info_no_rtti.hpp (original)
+++ branches/release/boost/serialization/extended_type_info_no_rtti.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -34,7 +34,7 @@
 #include <boost/config/abi_prefix.hpp> // must be the last header
 #ifdef BOOST_MSVC
 # pragma warning(push)
-# pragma warning(disable : 4251 4231 4660 4275)
+# pragma warning(disable : 4251 4231 4660 4275 4511 4512)
 #endif
 
 namespace boost {

Modified: branches/release/boost/serialization/extended_type_info_typeid.hpp
==============================================================================
--- branches/release/boost/serialization/extended_type_info_typeid.hpp (original)
+++ branches/release/boost/serialization/extended_type_info_typeid.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -35,9 +35,10 @@
 #include <boost/mpl/if.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last header
+
 #ifdef BOOST_MSVC
 # pragma warning(push)
-# pragma warning(disable : 4251 4231 4660 4275)
+# pragma warning(disable : 4251 4231 4660 4275 4511 4512)
 #endif
 
 namespace boost {

Modified: branches/release/boost/serialization/shared_ptr.hpp
==============================================================================
--- branches/release/boost/serialization/shared_ptr.hpp (original)
+++ branches/release/boost/serialization/shared_ptr.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -108,6 +108,7 @@
     ar << boost::serialization::make_nvp("px", t_ptr);
 }
 
+#ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
 template<class Archive, class T>
 inline void load(
     Archive & ar,
@@ -119,7 +120,6 @@
     // is never tracked by default. Wrap int in a trackable type
     BOOST_STATIC_ASSERT((tracking_level<T>::value != track_never));
     T* r;
- #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
     if(file_version < 1){
         //ar.register_type(static_cast<
         // boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter<T> > *
@@ -134,14 +134,29 @@
         ar.append(sp);
         r = sp.get();
     }
- else
- #endif
- {
+ else{
         ar >> boost::serialization::make_nvp("px", r);
     }
     ar.reset(t,r);
 }
 
+#else
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ boost::shared_ptr<T> &t,
+ const unsigned int /*file_version*/
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level<T>::value != track_never));
+ T* r;
+ ar >> boost::serialization::make_nvp("px", r);
+ ar.reset(t,r);
+}
+#endif
+
 template<class Archive, class T>
 inline void serialize(
     Archive & ar,

Modified: branches/release/boost/serialization/singleton.hpp
==============================================================================
--- branches/release/boost/serialization/singleton.hpp (original)
+++ branches/release/boost/serialization/singleton.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -35,9 +35,15 @@
 #endif
 
 #include <cassert>
+#include <boost/config.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/serialization/force_include.hpp>
 
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4511 4512)
+#endif
+
 namespace boost {
 namespace serialization {
 
@@ -71,7 +77,8 @@
 // attempt to retieve a mutable instances while locked will
 // generate a assertion if compiled for debug.
 
-class singleton_module : public boost::noncopyable
+class singleton_module :
+ public boost::noncopyable
 {
 private:
     static bool & get_lock(){
@@ -144,4 +151,8 @@
 } // namespace serialization
 } // namespace boost
 
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
 #endif // BOOST_SERIALIZATION_SINGLETON_HPP

Modified: branches/release/boost/serialization/slist.hpp
==============================================================================
--- branches/release/boost/serialization/slist.hpp (original)
+++ branches/release/boost/serialization/slist.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -69,7 +69,7 @@
     t.push_front(u.reference());
     BOOST_DEDUCED_TYPENAME BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>::iterator last;
     last = t.begin();
- std::size_t c = count;
+ collection_size_type c = count;
     while(--c > 0){
         boost::serialization::detail::stack_construct<Archive, U>
             u(ar, file_version);

Modified: branches/release/boost/serialization/static_warning.hpp
==============================================================================
--- branches/release/boost/serialization/static_warning.hpp (original)
+++ branches/release/boost/serialization/static_warning.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -77,7 +77,7 @@
 namespace serialization {
 
 template<int L>
-struct STATIC_WARNING_LINE{};
+struct BOOST_SERIALIZATION_STATIC_WARNING_LINE{};
 
 template<bool B, int L>
 struct static_warning_test{
@@ -86,23 +86,23 @@
         boost::mpl::true_,
         typename boost::mpl::identity<
             boost::mpl::print<
- STATIC_WARNING_LINE<L>
+ BOOST_SERIALIZATION_STATIC_WARNING_LINE<L>
>
>
>::type type;
 };
 
 template<int i>
-struct SS {};
+struct BOOST_SERIALIZATION_SS {};
 
 } // serialization
 } // boost
 
-#define BSW(B, L) \
- typedef boost::serialization::SS< \
+#define BOOST_SERIALIZATION_BSW(B, L) \
+ typedef boost::serialization::BOOST_SERIALIZATION_SS< \
         sizeof( boost::serialization::static_warning_test< B, L > ) \
> BOOST_JOIN(STATIC_WARNING_LINE, L);
 
-#define BOOST_STATIC_WARNING(B) BSW(B, __LINE__)
+#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__)
 
 #endif // BOOST_SERIALIZATION_STATIC_WARNING_HPP

Modified: branches/release/boost/serialization/variant.hpp
==============================================================================
--- branches/release/boost/serialization/variant.hpp (original)
+++ branches/release/boost/serialization/variant.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -46,7 +46,9 @@
 namespace serialization {
 
 template<class Archive>
-struct variant_save_visitor : boost::static_visitor<> {
+struct variant_save_visitor :
+ boost::static_visitor<>
+{
     variant_save_visitor(Archive& ar) :
         m_ar(ar)
     {}

Modified: branches/release/boost/serialization/void_cast.hpp
==============================================================================
--- branches/release/boost/serialization/void_cast.hpp (original)
+++ branches/release/boost/serialization/void_cast.hpp 2009-12-05 01:32:49 EST (Sat, 05 Dec 2009)
@@ -143,6 +143,11 @@
     virtual ~void_caster(){}
 };
 
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660 4275 4511 4512)
+#endif
+
 template <class Derived, class Base>
 class void_caster_primitive :
     public void_caster
@@ -163,7 +168,7 @@
     }
 public:
     void_caster_primitive();
- ~void_caster_primitive();
+ virtual ~void_caster_primitive();
 };
 
 template <class Derived, class Base>
@@ -208,9 +213,13 @@
         return b;
     }
     void_caster_virtual_base();
- ~void_caster_virtual_base();
+ virtual ~void_caster_virtual_base();
 };
 
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
 template <class Derived, class Base>
 void_caster_virtual_base<Derived,Base>::void_caster_virtual_base() :
     void_caster(


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