Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56317 - in branches/release/boost: archive archive/detail archive/impl serialization
From: ramey_at_[hidden]
Date: 2009-09-19 22:18:45


Author: ramey
Date: 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
New Revision: 56317
URL: http://svn.boost.org/trac/boost/changeset/56317

Log:
Merge trunk to release
Added:
   branches/release/boost/archive/detail/check.hpp
      - copied unchanged from r56315, /trunk/boost/archive/detail/check.hpp
Properties modified:
   branches/release/boost/archive/ (props changed)
   branches/release/boost/serialization/ (props changed)
Text files modified:
   branches/release/boost/archive/archive_exception.hpp | 92 ++++---------
   branches/release/boost/archive/basic_archive.hpp | 2
   branches/release/boost/archive/basic_binary_iarchive.hpp | 17 +
   branches/release/boost/archive/basic_binary_oarchive.hpp | 4
   branches/release/boost/archive/codecvt_null.hpp | 4
   branches/release/boost/archive/detail/archive_serializer_map.hpp | 6
   branches/release/boost/archive/detail/basic_serializer.hpp | 20 +-
   branches/release/boost/archive/detail/basic_serializer_map.hpp | 16 +
   branches/release/boost/archive/detail/iserializer.hpp | 226 ++++++++++++++++++---------------
   branches/release/boost/archive/detail/oserializer.hpp | 265 +++++++++++++++++----------------------
   branches/release/boost/archive/impl/archive_serializer_map.ipp | 2
   branches/release/boost/archive/impl/basic_binary_iprimitive.ipp | 29 +++-
   branches/release/boost/archive/impl/basic_xml_iarchive.ipp | 7
   branches/release/boost/archive/polymorphic_iarchive.hpp | 8
   branches/release/boost/archive/shared_ptr_helper.hpp | 135 +++++++++++---------
   branches/release/boost/archive/text_iarchive.hpp | 14 +
   branches/release/boost/archive/text_oarchive.hpp | 5
   branches/release/boost/archive/text_wiarchive.hpp | 4
   branches/release/boost/archive/xml_archive_exception.hpp | 35 +---
   branches/release/boost/archive/xml_iarchive.hpp | 4
   branches/release/boost/archive/xml_wiarchive.hpp | 4
   branches/release/boost/serialization/array.hpp | 2
   branches/release/boost/serialization/binary_object.hpp | 25 ---
   branches/release/boost/serialization/export.hpp | 93 +++++++------
   branches/release/boost/serialization/extended_type_info.hpp | 37 ++++-
   branches/release/boost/serialization/extended_type_info_no_rtti.hpp | 60 +++++++-
   branches/release/boost/serialization/extended_type_info_typeid.hpp | 26 ++-
   branches/release/boost/serialization/level.hpp | 15 +
   branches/release/boost/serialization/nvp.hpp | 7
   branches/release/boost/serialization/serialization.hpp | 4
   branches/release/boost/serialization/shared_ptr.hpp | 6
   branches/release/boost/serialization/static_warning.hpp | 141 ++++----------------
   branches/release/boost/serialization/tracking.hpp | 9 +
   branches/release/boost/serialization/vector.hpp | 17 +
   branches/release/boost/serialization/vector_135.hpp | 8
   branches/release/boost/serialization/version.hpp | 27 ++-
   branches/release/boost/serialization/void_cast.hpp | 22 +++
   branches/release/boost/serialization/wrapper.hpp | 51 +++----
   38 files changed, 733 insertions(+), 716 deletions(-)

Modified: branches/release/boost/archive/archive_exception.hpp
==============================================================================
--- branches/release/boost/archive/archive_exception.hpp (original)
+++ branches/release/boost/archive/archive_exception.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -18,6 +18,21 @@
 
 #include <exception>
 #include <cassert>
+#include <string>
+
+#include <boost/config.hpp>
+#include <boost/preprocessor/empty.hpp>
+#include <boost/archive/detail/decl.hpp>
+
+// note: the only reason this is in here is that windows header
+// includes #define exception_code _exception_code (arrrgghhhh!).
+// the most expedient way to address this is be sure that this
+// header is always included whenever this header file is included.
+#if defined(BOOST_WINDOWS)
+#include <excpt.h>
+#endif
+
+#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost {
 namespace archive {
@@ -25,7 +40,7 @@
 //////////////////////////////////////////////////////////////////////
 // exceptions thrown by archives
 //
-class archive_exception :
+class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) archive_exception :
     public virtual std::exception
 {
 public:
@@ -55,72 +70,27 @@
         unsupported_class_version, // type saved with a version # greater than the
                             // one used by the program. This indicates that the proggram
                             // needs to be rebuilt.
- inconsistent_pointer_serialization // an object as been serialized
- // more than once through pointers of different types.
+ multiple_code_instantiation // code for implementing serialization for some
+ // type has been instantiated in more than one module.
     } exception_code;
+protected:
+ std::string m_msg;
+public:
     exception_code code;
- archive_exception(exception_code c) :
- code(c)
- {}
- virtual const char *what( ) const throw( )
- {
- const char *msg = "programming error";
- switch(code){
- case no_exception:
- msg = "uninitialized exception";
- break;
- case unregistered_class:
- msg = "unregistered class";
- break;
- case invalid_signature:
- msg = "invalid signature";
- break;
- case unsupported_version:
- msg = "unsupported version";
- break;
- case pointer_conflict:
- msg = "pointer conflict";
- break;
- case incompatible_native_format:
- msg = "incompatible native format";
- break;
- case array_size_too_short:
- msg = "array size too short";
- break;
- case stream_error:
- msg = "stream error";
- break;
- case invalid_class_name:
- msg = "class name too long";
- break;
- case unregistered_cast:
- msg = "unregistered void cast";
- break;
- case unsupported_class_version:
- msg = "class version";
- break;
- case other_exception:
- // if get here - it indicates a derived exception
- // was sliced by passing by value in catch
- msg = "unknown derived exception";
- break;
- case inconsistent_pointer_serialization:
- // same object saved through different kinds of pointers
- msg = "inconsistent_pointer_serialization";
- break;
- default:
- assert(false);
- break;
- }
- return msg;
- }
+ archive_exception(
+ exception_code c,
+ const char * e1 = NULL,
+ const char * e2 = NULL
+ );
+ ~archive_exception() throw ();
+ virtual const char *what( ) const throw();
 protected:
- archive_exception() :
- code(no_exception)
- {}
+ archive_exception();
 };
 
 }// namespace archive
 }// namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 #endif //BOOST_ARCHIVE_ARCHIVE_EXCEPTION_HPP

Modified: branches/release/boost/archive/basic_archive.hpp
==============================================================================
--- branches/release/boost/archive/basic_archive.hpp (original)
+++ branches/release/boost/archive/basic_archive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -34,7 +34,7 @@
 BOOST_STRONG_TYPEDEF(unsigned int, object_reference_type)
 
 struct tracking_type {
- typedef bool value_type;
+// typedef bool value_type;
     bool t;
     explicit tracking_type(const bool t_ = false)
         : t(t_)

Modified: branches/release/boost/archive/basic_binary_iarchive.hpp
==============================================================================
--- branches/release/boost/archive/basic_binary_iarchive.hpp (original)
+++ branches/release/boost/archive/basic_binary_iarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -101,11 +101,18 @@
         * this->This() >> x;
         t = (0 != x);
     }
- void load_override(serialization::collection_size_type & t, int){
- unsigned int x=0;
- * this->This() >> x;
- t = serialization::collection_size_type(x);
- }
+ void load_override(serialization::collection_size_type & t, int){
+ if (this->get_library_version() < 6) {
+ unsigned int x=0;
+ * this->This() >> x;
+ t = serialization::collection_size_type(x);
+ }
+ else {
+ std::size_t x=0;
+ * this->This() >> x;
+ t = serialization::collection_size_type(x);
+ }
+ }
 
     BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
     load_override(class_name_type & t, int);

Modified: branches/release/boost/archive/basic_binary_oarchive.hpp
==============================================================================
--- branches/release/boost/archive/basic_binary_oarchive.hpp (original)
+++ branches/release/boost/archive/basic_binary_oarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -85,7 +85,7 @@
     }
     void save_override(const class_id_reference_type & t, int){
         // upto 32K classes
- assert(t.t <= boost::integer_traits<boost::uint_least32_t>::const_max);
+ assert(t.t <= boost::integer_traits<boost::int_least16_t>::const_max);
         const boost::uint_least16_t x = t.t;
         * this->This() << x;
     }
@@ -114,7 +114,7 @@
 
     void save_override(const serialization::collection_size_type & t, int){
     // for backward compatibility, 64 bit integer or variable length integer would be preferred
- unsigned int x = t.t;
+ std::size_t x = t.t;
         * this->This() << x;
    }
 

Modified: branches/release/boost/archive/codecvt_null.hpp
==============================================================================
--- branches/release/boost/archive/codecvt_null.hpp (original)
+++ branches/release/boost/archive/codecvt_null.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -24,13 +24,15 @@
 #include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 #if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std {
 // For STLport on WinCE, BOOST_NO_STDC_NAMESPACE can get defined if STLport is putting symbols in its own namespace.
 // In the case of codecvt, however, this does not mean that codecvt is in the global namespace (it will be in STLport's namespace)
-# if !defined(UNDER_CE) || (!defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION))
+# if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
     using ::codecvt;
 # endif
     using ::mbstate_t;
     using ::size_t;
+} // namespace
 #endif
 
 namespace boost {

Modified: branches/release/boost/archive/detail/archive_serializer_map.hpp
==============================================================================
--- branches/release/boost/archive/detail/archive_serializer_map.hpp (original)
+++ branches/release/boost/archive/detail/archive_serializer_map.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -7,10 +7,10 @@
 #endif
 
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// archive_pointer_oserializer.hpp: extenstion of type_info required for
+// archive_serializer_map.hpp: extenstion of type_info required for
 // serialization.
 
-// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2009 Robert Ramey - http://www.rrsd.com .
 // Use, modification and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
@@ -39,7 +39,7 @@
 class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) archive_serializer_map
 {
 public:
- static void insert(const basic_serializer * bs);
+ static bool insert(const basic_serializer * bs);
     static void erase(const basic_serializer * bs);
     static const basic_serializer * find(
         const boost::serialization::extended_type_info & type_

Modified: branches/release/boost/archive/detail/basic_serializer.hpp
==============================================================================
--- branches/release/boost/archive/detail/basic_serializer.hpp (original)
+++ branches/release/boost/archive/detail/basic_serializer.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -40,20 +40,22 @@
         assert(NULL != & eti);
     }
 public:
+ inline bool
+ operator<(const basic_serializer & rhs) const {
+ // can't compare address since there can be multiple eti records
+ // for the same type in different execution modules (that is, DLLS)
+ // leave this here as a reminder not to do this!
+ // return & lhs.get_eti() < & rhs.get_eti();
+ return get_eti() < rhs.get_eti();
+ }
+ const char * get_debug_info() const {
+ return m_eti->get_debug_info();
+ }
     const boost::serialization::extended_type_info & get_eti() const {
         return * m_eti;
     }
 };
 
-inline bool
-operator<(const basic_serializer & lhs, const basic_serializer & rhs) {
- // can't compare address since there can be multiple eti records
- // for the same type in different execution modules (that is, DLLS)
- // leave this here as a reminder not to do this!
- // return & lhs.get_eti() < & rhs.get_eti();
- return lhs.get_eti() < rhs.get_eti();
-}
-
 class basic_serializer_arg : public basic_serializer {
 public:
     basic_serializer_arg(const serialization::extended_type_info & eti) :

Modified: branches/release/boost/archive/detail/basic_serializer_map.hpp
==============================================================================
--- branches/release/boost/archive/detail/basic_serializer_map.hpp (original)
+++ branches/release/boost/archive/detail/basic_serializer_map.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -16,13 +16,13 @@
 
 // See http://www.boost.org for updates, documentation, and revision history.
 
-#include <list>
+#include <set>
 
 #include <boost/config.hpp>
+#include <boost/utility.hpp>
 #include <boost/archive/detail/auto_link_archive.hpp>
-#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
-#include <boost/utility.hpp>
+#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost {
 namespace serialization {
@@ -37,10 +37,16 @@
 class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_serializer_map : public
     boost::noncopyable
 {
- typedef std::list<const basic_serializer *> map_type;
+ struct type_info_pointer_compare
+ {
+ bool operator()(
+ const basic_serializer * lhs, const basic_serializer * rhs
+ ) const ;
+ };
+ typedef std::set<const basic_serializer *, type_info_pointer_compare> map_type;
     map_type m_map;
 public:
- void insert(const basic_serializer * bs);
+ bool insert(const basic_serializer * bs);
     void erase(const basic_serializer * bs);
     const basic_serializer * find(
         const boost::serialization::extended_type_info & type_

Modified: branches/release/boost/archive/detail/iserializer.hpp
==============================================================================
--- branches/release/boost/archive/detail/iserializer.hpp (original)
+++ branches/release/boost/archive/detail/iserializer.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -33,54 +33,43 @@
     using ::size_t;
 } // namespace std
 #endif
+
+#include <boost/static_assert.hpp>
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/greater_equal.hpp>
+#include <boost/mpl/equal_to.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
+
+#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
+ #include <boost/serialization/extended_type_info_typeid.hpp>
+#endif
 #include <boost/serialization/throw_exception.hpp>
 #include <boost/serialization/smart_cast.hpp>
-#include <boost/static_assert.hpp>
 #include <boost/serialization/static_warning.hpp>
-#include <boost/detail/no_exceptions_support.hpp>
 
 #include <boost/type_traits/is_pointer.hpp>
 #include <boost/type_traits/is_enum.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/type_traits/remove_extent.hpp>
-#include <boost/serialization/assume_abstract.hpp>
 #include <boost/type_traits/is_polymorphic.hpp>
 
+#include <boost/serialization/assume_abstract.hpp>
+
 #define DONT_USE_HAS_NEW_OPERATOR ( \
     defined(__BORLANDC__) \
     || defined(__IBMCPP__) \
     || defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) \
- || defined(__SUNPRO_CC) && (__SUBPRO_CC < 0x590) \
+ || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590) \
 )
 
 #if ! DONT_USE_HAS_NEW_OPERATOR
 #include <boost/type_traits/has_new_operator.hpp>
 #endif
 
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/identity.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/less.hpp>
-#include <boost/mpl/greater_equal.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/list.hpp>
-#include <boost/mpl/empty.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/mpl/bool.hpp>
-
-#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
- #include <boost/serialization/extended_type_info_typeid.hpp>
-#endif
-// the following is need only for dynamic cast of polymorphic pointers
-#include <boost/archive/detail/basic_iarchive.hpp>
-#include <boost/archive/detail/basic_iserializer.hpp>
-#include <boost/archive/detail/basic_pointer_iserializer.hpp>
-#include <boost/archive/detail/archive_serializer_map.hpp>
-#include <boost/archive/archive_exception.hpp>
-
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/version.hpp>
 #include <boost/serialization/level.hpp>
@@ -91,6 +80,15 @@
 #include <boost/serialization/array.hpp>
 #include <boost/serialization/collection_size_type.hpp>
 #include <boost/serialization/singleton.hpp>
+#include <boost/serialization/wrapper.hpp>
+
+// the following is need only for dynamic cast of polymorphic pointers
+#include <boost/archive/archive_exception.hpp>
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/archive/detail/basic_iserializer.hpp>
+#include <boost/archive/detail/basic_pointer_iserializer.hpp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/archive/detail/check.hpp>
 
 namespace boost {
 
@@ -123,8 +121,10 @@
     // protected constructor since it's always created by singleton
     explicit iserializer() :
         basic_iserializer(
- boost::serialization::type_info_implementation<T>::type
- ::get_const_instance()
+ boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance()
         )
     {}
 public:
@@ -161,9 +161,12 @@
 ) const {
     // trap case where the program cannot handle the current version
     if(file_version > version())
- boost::serialization::throw_exception(archive::archive_exception(
- boost::archive::archive_exception::unsupported_class_version
- ));
+ boost::serialization::throw_exception(
+ archive::archive_exception(
+ boost::archive::archive_exception::unsupported_class_version,
+ get_debug_info()
+ )
+ );
 
     // make sure call is routed through the higest interface that might
     // be specialized by the user.
@@ -308,8 +311,10 @@
 template<class Archive, class T>
 pointer_iserializer<Archive, T>::pointer_iserializer() :
     basic_pointer_iserializer(
- boost::serialization::type_info_implementation<T>::type
- ::get_const_instance()
+ boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance()
     )
 {
     boost::serialization::singleton<
@@ -323,11 +328,12 @@
     archive_serializer_map<Archive>::erase(this);
 }
 
-template<class Archive, class T>
+template<class Archive>
 struct load_non_pointer_type {
     // note this bounces the call right back to the archive
     // with no runtime overhead
     struct load_primitive {
+ template<class T>
         static void invoke(Archive & ar, T & t){
             load_access::load_primitive(ar, t);
         }
@@ -335,12 +341,15 @@
     // note this bounces the call right back to the archive
     // with no runtime overhead
     struct load_only {
- static void invoke(Archive & ar, T & t){
+ template<class T>
+ static void invoke(Archive & ar, const T & t){
             // short cut to user's serializer
             // make sure call is routed through the higest interface that might
             // be specialized by the user.
             boost::serialization::serialize_adl(
- ar, t, boost::serialization::version<T>::value
+ ar,
+ const_cast<T &>(t),
+ boost::serialization::version<T>::value
             );
         }
     };
@@ -348,12 +357,9 @@
     // note this save class information including version
     // and serialization level to the archive
     struct load_standard {
- static void invoke(Archive &ar, T &t){
- //BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
- // borland - for some reason T is const here - even though
- // its not called that way - so fix it her
- typedef BOOST_DEDUCED_TYPENAME boost::remove_const<T>::type typex;
- void * x = & const_cast<typex &>(t);
+ template<class T>
+ static void invoke(Archive &ar, const T & t){
+ void * x = & const_cast<T &>(t);
             ar.load_object(
                 x,
                 boost::serialization::singleton<
@@ -364,6 +370,7 @@
     };
 
     struct load_conditional {
+ template<class T>
         static void invoke(Archive &ar, T &t){
             //if(0 == (ar.get_flags() & no_tracking))
                 load_standard::invoke(ar, t);
@@ -372,57 +379,48 @@
         }
     };
 
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
- // if its primitive
- mpl::equal_to<
- boost::serialization::implementation_level<T>,
- mpl::int_<boost::serialization::primitive_type>
- >,
- mpl::identity<load_primitive>,
- // else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- // class info / version
- mpl::greater_equal<
+ template<class T>
+ static void invoke(Archive & ar, T &t){
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ // if its primitive
+ mpl::equal_to<
                     boost::serialization::implementation_level<T>,
- mpl::int_<boost::serialization::object_class_info>
+ mpl::int_<boost::serialization::primitive_type>
>,
- // do standard load
- mpl::identity<load_standard>,
- // else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- // no tracking
- mpl::equal_to<
- boost::serialization::tracking_level<T>,
- mpl::int_<boost::serialization::track_never>
- >,
- // do a fast load
- mpl::identity<load_only>,
- // else
- // do a fast load only tracking is turned off
- mpl::identity<load_conditional>
- > > >::type typex;
-
- static void invoke(Archive & ar, T &t){
- // check that we're not trying to serialize something that
- // has been marked not to be serialized. If this your program
- // traps here, you've tried to serialize a class whose trait
- // has been marked "non-serializable". Either reset the trait
- // (see level.hpp) or change program not to serialize items of this class
- BOOST_STATIC_ASSERT((
+ mpl::identity<load_primitive>,
+ // else
+ BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ // class info / version
             mpl::greater_equal<
- boost::serialization::implementation_level<T>,
- mpl::int_<boost::serialization::primitive_type>
- >::value
- ));
+ boost::serialization::implementation_level<T>,
+ mpl::int_<boost::serialization::object_class_info>
+ >,
+ // do standard load
+ mpl::identity<load_standard>,
+ // else
+ BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ // no tracking
+ mpl::equal_to<
+ boost::serialization::tracking_level<T>,
+ mpl::int_<boost::serialization::track_never>
+ >,
+ // do a fast load
+ mpl::identity<load_only>,
+ // else
+ // do a fast load only tracking is turned off
+ mpl::identity<load_conditional>
+ > > >::type typex;
+ check_object_versioning<T>();
+ check_object_level<T>();
         typex::invoke(ar, t);
     }
 };
 
-template<class Archive, class Tptr>
+template<class Archive>
 struct load_pointer_type {
- template<class T>
     struct abstract
     {
+ template<class T>
         static const basic_pointer_iserializer * register_type(Archive & /* ar */){
             // it has? to be polymorphic
             BOOST_STATIC_ASSERT(boost::is_polymorphic<T>::value);
@@ -430,9 +428,9 @@
          }
     };
 
- template<class T>
     struct non_abstract
     {
+ template<class T>
         static const basic_pointer_iserializer * register_type(Archive & ar){
             return ar.register_type(static_cast<T *>(NULL));
         }
@@ -447,10 +445,10 @@
         typedef BOOST_DEDUCED_TYPENAME
             mpl::eval_if<
                 boost::serialization::is_abstract<const T>,
- mpl::identity<abstract<T> >,
- mpl::identity<non_abstract<T> >
+ boost::mpl::identity<abstract>,
+ boost::mpl::identity<non_abstract>
>::type typex;
- return typex::register_type(ar);
+ return typex::template register_type<T>(ar);
     }
 
     template<class T>
@@ -463,14 +461,24 @@
         return static_cast<T *>(
             boost::serialization::void_upcast(
                 eti,
- boost::serialization::type_info_implementation<T>::type
- ::get_const_instance(),
+ boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance(),
                 t
             )
         );
     }
 
+ template<class T>
+ static void load(Archive &ar, T & t){
+ check_pointer_level<T>();
+ check_pointer_tracking<T>();
+ }
+
+ template<class Tptr>
     static void invoke(Archive & ar, Tptr & t){
+ load(ar, *t);
         const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t);
         const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer(
             * reinterpret_cast<void **>(&t),
@@ -483,8 +491,9 @@
     }
 };
 
-template<class Archive, class T>
+template<class Archive>
 struct load_enum_type {
+ template<class T>
     static void invoke(Archive &ar, T &t){
         // convert integers to correct enum to load
         int i;
@@ -493,8 +502,9 @@
     }
 };
 
-template<class Archive, class T>
+template<class Archive>
 struct load_array_type {
+ template<class T>
     static void invoke(Archive &ar, T &t){
         typedef BOOST_DEDUCED_TYPENAME remove_extent<T>::type value_type;
         
@@ -502,16 +512,18 @@
         // determine number of elements in the array. Consider the
         // fact that some machines will align elements on boundries
         // other than characters.
- int current_count = sizeof(t) / (
+ std::size_t current_count = sizeof(t) / (
             static_cast<char *>(static_cast<void *>(&t[1]))
             - static_cast<char *>(static_cast<void *>(&t[0]))
         );
- int count;
+ boost::serialization::collection_size_type count;
         ar >> BOOST_SERIALIZATION_NVP(count);
- if(count > current_count)
- boost::serialization::throw_exception(archive::archive_exception(
- boost::archive::archive_exception::array_size_too_short
- ));
+ if(static_cast<std::size_t>(count) > current_count)
+ boost::serialization::throw_exception(
+ archive::archive_exception(
+ boost::archive::archive_exception::array_size_too_short
+ )
+ );
         ar >> serialization::make_array(static_cast<value_type*>(&t[0]),count);
     }
 };
@@ -519,33 +531,35 @@
 } // detail
 
 template<class Archive, class T>
-inline void load(Archive &ar, T &t){
+inline void load(Archive & ar, T &t){
     // if this assertion trips. It means we're trying to load a
     // const object with a compiler that doesn't have correct
     // funtion template ordering. On other compilers, this is
     // handled below.
- BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
+ detail::check_const_loading<T>();
     typedef
         BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer<T>,
- mpl::identity<detail::load_pointer_type<Archive, T> >
+ mpl::identity<detail::load_pointer_type<Archive> >
         ,//else
         BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array<T>,
- mpl::identity<detail::load_array_type<Archive, T> >
+ mpl::identity<detail::load_array_type<Archive> >
         ,//else
         BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum<T>,
- mpl::identity<detail::load_enum_type<Archive, T> >
+ mpl::identity<detail::load_enum_type<Archive> >
         ,//else
- mpl::identity<detail::load_non_pointer_type<Archive, T> >
+ mpl::identity<detail::load_non_pointer_type<Archive> >
>
>
>::type typex;
     typex::invoke(ar, t);
 }
 
+#if 0
+
 // BORLAND
 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
 // borland has a couple of problems
-// a) if function is partiall specialized - see below
+// a) if function is partially specialized - see below
 // const paramters are transformed to non-const ones
 // b) implementation of base_object can't be made to work
 // correctly which results in all base_object s being const.
@@ -572,6 +586,8 @@
 #endif
 #endif
 
+#endif
+
 } // namespace archive
 } // namespace boost
 

Modified: branches/release/boost/archive/detail/oserializer.hpp
==============================================================================
--- branches/release/boost/archive/detail/oserializer.hpp (original)
+++ branches/release/boost/archive/detail/oserializer.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -26,37 +26,27 @@
 #include <cstddef> // NULL
 
 #include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-#include <boost/serialization/throw_exception.hpp>
-#include <boost/serialization/smart_cast.hpp>
 #include <boost/static_assert.hpp>
-#include <boost/serialization/static_warning.hpp>
-
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_enum.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/type_traits/is_polymorphic.hpp>
-#include <boost/type_traits/remove_extent.hpp>
-#include <boost/serialization/assume_abstract.hpp>
+#include <boost/detail/workaround.hpp>
 
 #include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/greater_equal.hpp>
 #include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/int.hpp>
+#include <boost/mpl/greater_equal.hpp>
 #include <boost/mpl/identity.hpp>
-#include <boost/mpl/not.hpp>
 
 #ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
     #include <boost/serialization/extended_type_info_typeid.hpp>
 #endif
+#include <boost/serialization/throw_exception.hpp>
+#include <boost/serialization/smart_cast.hpp>
+#include <boost/serialization/assume_abstract.hpp>
+#include <boost/serialization/static_warning.hpp>
 
-// the following is need only for dynamic cast of polymorphic pointers
-#include <boost/archive/detail/basic_oarchive.hpp>
-#include <boost/archive/detail/basic_oserializer.hpp>
-#include <boost/archive/detail/basic_pointer_oserializer.hpp>
-#include <boost/archive/detail/archive_serializer_map.hpp>
-#include <boost/archive/archive_exception.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+#include <boost/type_traits/remove_extent.hpp>
 
 #include <boost/serialization/serialization.hpp>
 #include <boost/serialization/version.hpp>
@@ -69,6 +59,13 @@
 #include <boost/serialization/collection_size_type.hpp>
 #include <boost/serialization/singleton.hpp>
 
+#include <boost/archive/archive_exception.hpp>
+#include <boost/archive/detail/basic_oarchive.hpp>
+#include <boost/archive/detail/basic_oserializer.hpp>
+#include <boost/archive/detail/basic_pointer_oserializer.hpp>
+#include <boost/archive/detail/archive_serializer_map.hpp>
+#include <boost/archive/detail/check.hpp>
+
 namespace boost {
 
 namespace serialization {
@@ -103,8 +100,10 @@
 public:
     explicit BOOST_DLLEXPORT oserializer() :
         basic_oserializer(
- boost::serialization::type_info_implementation<T>::type
- ::get_const_instance()
+ boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance()
         )
     {}
     virtual BOOST_DLLEXPORT void save_object_data(
@@ -187,8 +186,10 @@
 template<class Archive, class T>
 pointer_oserializer<Archive, T>::pointer_oserializer() :
     basic_pointer_oserializer(
- boost::serialization::type_info_implementation<T>::type
- ::get_const_instance()
+ boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance()
     )
 {
     // make sure appropriate member function is instantiated
@@ -203,17 +204,19 @@
     archive_serializer_map<Archive>::erase(this);
 }
 
-template<class Archive, class T>
+template<class Archive>
 struct save_non_pointer_type {
     // note this bounces the call right back to the archive
     // with no runtime overhead
     struct save_primitive {
+ template<class T>
         static void invoke(Archive & ar, const T & t){
             save_access::save_primitive(ar, t);
         }
     };
     // same as above but passes through serialization
     struct save_only {
+ template<class T>
         static void invoke(Archive & ar, const T & t){
             // make sure call is routed through the highest interface that might
             // be specialized by the user.
@@ -227,6 +230,7 @@
     // adds class information to the archive. This includes
     // serialization level and class version
     struct save_standard {
+ template<class T>
         static void invoke(Archive &ar, const T & t){
             ar.save_object(
                 & t,
@@ -240,6 +244,7 @@
     // adds class information to the archive. This includes
     // serialization level and class version
     struct save_conditional {
+ template<class T>
         static void invoke(Archive &ar, const T &t){
             //if(0 == (ar.get_flags() & no_tracking))
                 save_standard::invoke(ar, t);
@@ -248,58 +253,55 @@
         }
     };
 
- typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- // if its primitive
- mpl::equal_to<
- boost::serialization::implementation_level<T>,
- mpl::int_<boost::serialization::primitive_type>
- >,
- mpl::identity<save_primitive>,
- // else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- // class info / version
- mpl::greater_equal<
- boost::serialization::implementation_level<T>,
- mpl::int_<boost::serialization::object_class_info>
- >,
- // do standard save
- mpl::identity<save_standard>,
- // else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- // no tracking
- mpl::equal_to<
- boost::serialization::tracking_level<T>,
- mpl::int_<boost::serialization::track_never>
- >,
- // do a fast save
- mpl::identity<save_only>,
- // else
- // do a fast save only tracking is turned off
- mpl::identity<save_conditional>
- > > >::type typex;
 
+ template<class T>
     static void invoke(Archive & ar, const T & t){
- // check that we're not trying to serialize something that
- // has been marked not to be serialized. If this your program
- // traps here, you've tried to serialize a class whose trait
- // has been marked "non-serializable". Either reset the trait
- // (see level.hpp) or change program not to serialize items of this class
- BOOST_STATIC_ASSERT((
- mpl::greater_equal<
- boost::serialization::implementation_level<T>,
- mpl::int_<boost::serialization::primitive_type>
- >::value
- ));
+ typedef
+ BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ // if its primitive
+ mpl::equal_to<
+ boost::serialization::implementation_level<T>,
+ mpl::int_<boost::serialization::primitive_type>
+ >,
+ mpl::identity<save_primitive>,
+ // else
+ BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ // class info / version
+ mpl::greater_equal<
+ boost::serialization::implementation_level<T>,
+ mpl::int_<boost::serialization::object_class_info>
+ >,
+ // do standard save
+ mpl::identity<save_standard>,
+ // else
+ BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ // no tracking
+ mpl::equal_to<
+ boost::serialization::tracking_level<T>,
+ mpl::int_<boost::serialization::track_never>
+ >,
+ // do a fast save
+ mpl::identity<save_only>,
+ // else
+ // do a fast save only tracking is turned off
+ mpl::identity<save_conditional>
+ > > >::type typex;
+ check_object_versioning<T>();
         typex::invoke(ar, t);
     };
+ template<class T>
+ static void invoke(Archive & ar, T & t){
+ check_object_level<T>();
+ check_object_tracking<T>();
+ invoke(ar, const_cast<const T &>(t));
+ };
 };
 
-template<class Archive, class TPtr>
+template<class Archive>
 struct save_pointer_type {
- template<class T>
     struct abstract
     {
+ template<class T>
         static const basic_pointer_oserializer * register_type(Archive & /* ar */){
             // it has? to be polymorphic
             BOOST_STATIC_ASSERT(boost::is_polymorphic<T>::value);
@@ -307,9 +309,9 @@
         }
     };
 
- template<class T>
     struct non_abstract
     {
+ template<class T>
         static const basic_pointer_oserializer * register_type(Archive & ar){
             return ar.register_type(static_cast<T *>(NULL));
         }
@@ -324,15 +326,15 @@
         typedef
             BOOST_DEDUCED_TYPENAME mpl::eval_if<
                 boost::serialization::is_abstract<T>,
- mpl::identity<abstract<T> >,
- mpl::identity<non_abstract<T> >
+ mpl::identity<abstract>,
+ mpl::identity<non_abstract>
>::type typex;
- return typex::register_type(ar);
+ return typex::template register_type<T>(ar);
     }
 
- template<class T>
     struct non_polymorphic
     {
+ template<class T>
         static void save(
             Archive &ar,
             T & t
@@ -346,17 +348,19 @@
         }
     };
 
- template<class T>
     struct polymorphic
     {
+ template<class T>
         static void save(
             Archive &ar,
             T & t
         ){
             BOOST_DEDUCED_TYPENAME
             boost::serialization::type_info_implementation<T>::type const
- & i = boost::serialization::type_info_implementation<T>::type
- ::get_const_instance();
+ & i = boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance();
 
             boost::serialization::extended_type_info const * const this_type = & i;
 
@@ -371,7 +375,10 @@
             // is either registered or exported.
             if(NULL == true_type){
                 boost::serialization::throw_exception(
- archive_exception(archive_exception::unregistered_class)
+ archive_exception(
+ archive_exception::unregistered_class,
+ true_type->get_debug_info()
+ )
                 );
             }
 
@@ -391,7 +398,11 @@
             );
             if(NULL == vp){
                 boost::serialization::throw_exception(
- archive_exception(archive_exception::unregistered_cast)
+ archive_exception(
+ archive_exception::unregistered_cast,
+ true_type->get_debug_info(),
+ this_type->get_debug_info()
+ )
                 );
             }
 
@@ -407,49 +418,32 @@
             assert(NULL != bpos);
             if(NULL == bpos)
                 boost::serialization::throw_exception(
- archive_exception(archive_exception::unregistered_class)
+ archive_exception(
+ archive_exception::unregistered_class,
+ bpos->get_debug_info()
+ )
                 );
             ar.save_pointer(vp, bpos);
         }
     };
 
- // out of line selector works around borland quirk
- template<class T>
- struct conditional {
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
- is_polymorphic<T>,
- mpl::identity<polymorphic<T> >,
- mpl::identity<non_polymorphic<T> >
- >::type type;
- };
-
- // used to convert TPtr in to a pointer to a T
     template<class T>
     static void save(
         Archive & ar,
         const T & t
     ){
- conditional<T>::type::save(ar, const_cast<T &>(t));
- }
-
- template<class T>
- static void const_check(T & t){
- BOOST_STATIC_ASSERT(! boost::is_const<T>::value);
+ check_pointer_level<T>();
+ check_pointer_tracking<T>();
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ is_polymorphic<T>,
+ mpl::identity<polymorphic>,
+ mpl::identity<non_polymorphic>
+ >::type type;
+ type::save(ar, const_cast<T &>(t));
     }
 
+ template<class TPtr>
     static void invoke(Archive &ar, const TPtr t){
- #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- // if your program traps here, its because you tried to do
- // something like ar << t where t is a pointer to a const value
- // void f3(A const* a, text_oarchive& oa)
- // {
- // oa << a;
- // }
- // with a compiler which doesn't support remove_const
- // const_check(* t);
- #else
- // otherwise remove the const
- #endif
         register_type(ar, * t);
         if(NULL == t){
             basic_oarchive & boa
@@ -462,9 +456,10 @@
     };
 };
 
-template<class Archive, class T>
+template<class Archive>
 struct save_enum_type
 {
+ template<class T>
     static void invoke(Archive &ar, const T &t){
         // convert enum to integers on save
         const int i = static_cast<int>(t);
@@ -472,18 +467,20 @@
     }
 };
 
-template<class Archive, class T>
+template<class Archive>
 struct save_array_type
 {
+ template<class T>
     static void invoke(Archive &ar, const T &t){
         typedef BOOST_DEDUCED_TYPENAME boost::remove_extent<T>::type value_type;
         
         save_access::end_preamble(ar);
         // consider alignment
- int count = sizeof(t) / (
+ std::size_t c = sizeof(t) / (
             static_cast<const char *>(static_cast<const void *>(&t[1]))
             - static_cast<const char *>(static_cast<const void *>(&t[0]))
         );
+ boost::serialization::collection_size_type count(c);
         ar << BOOST_SERIALIZATION_NVP(count);
         ar << serialization::make_array(static_cast<value_type const*>(&t[0]),count);
     }
@@ -492,58 +489,24 @@
 } // detail
 
 template<class Archive, class T>
-inline void save(Archive & ar, const T &t){
+inline void save(Archive & ar, /*const*/ T &t){
     typedef
         BOOST_DEDUCED_TYPENAME mpl::eval_if<is_pointer<T>,
- mpl::identity<detail::save_pointer_type<Archive, T> >,
+ mpl::identity<detail::save_pointer_type<Archive> >,
         //else
         BOOST_DEDUCED_TYPENAME mpl::eval_if<is_enum<T>,
- mpl::identity<detail::save_enum_type<Archive, T> >,
+ mpl::identity<detail::save_enum_type<Archive> >,
         //else
         BOOST_DEDUCED_TYPENAME mpl::eval_if<is_array<T>,
- mpl::identity<detail::save_array_type<Archive, T> >,
+ mpl::identity<detail::save_array_type<Archive> >,
         //else
- mpl::identity<detail::save_non_pointer_type<Archive, T> >
+ mpl::identity<detail::save_non_pointer_type<Archive> >
>
>
>::type typex;
     typex::invoke(ar, t);
 }
 
-#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-
-template<class T>
-struct check_tracking {
- typedef BOOST_DEDUCED_TYPENAME mpl::if_<
- // if its never tracked.
- BOOST_DEDUCED_TYPENAME mpl::equal_to<
- serialization::tracking_level<T>,
- mpl::int_<serialization::track_never>
- >,
- // it better not be a pointer
- mpl::not_<is_pointer<T> >,
- //else
- // otherwise if it might be tracked. So there shouldn't
- // be any problem making a const
- is_const<T>
- >::type typex;
- BOOST_STATIC_CONSTANT(bool, value = typex::value);
-};
-
-template<class Archive, class T>
-inline void save(Archive & ar, T &t){
- // if your program traps here, it indicates that your doing one of the following:
- // a) serializing an object of a type marked "track_never" through a pointer.
- // b) saving an non-const object of a type not markd "track_never)
- // Either of these conditions may be an indicator of an error usage of the
- // serialization library and should be double checked. See documentation on
- // object tracking. Also, see the "rationale" section of the documenation
- // for motivation for this checking.
- BOOST_STATIC_WARNING(check_tracking<T>::value);
- save(ar, const_cast<const T &>(t));
-}
-#endif
-
 } // namespace archive
 } // namespace boost
 

Modified: branches/release/boost/archive/impl/archive_serializer_map.ipp
==============================================================================
--- branches/release/boost/archive/impl/archive_serializer_map.ipp (original)
+++ branches/release/boost/archive/impl/archive_serializer_map.ipp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -28,7 +28,7 @@
 }
 
 template<class Archive>
-BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
+BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool)
 archive_serializer_map<Archive>::insert(const basic_serializer * bs){
     return boost::serialization::singleton<
         map<Archive>

Modified: branches/release/boost/archive/impl/basic_binary_iprimitive.ipp
==============================================================================
--- branches/release/boost/archive/impl/basic_binary_iprimitive.ipp (original)
+++ branches/release/boost/archive/impl/basic_binary_iprimitive.ipp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -46,22 +46,34 @@
     this->This()->load(size);
     if(sizeof(int) != size)
         boost::serialization::throw_exception(
- archive_exception(archive_exception::incompatible_native_format)
+ archive_exception(
+ archive_exception::incompatible_native_format,
+ "size of int"
+ )
         );
     this->This()->load(size);
     if(sizeof(long) != size)
         boost::serialization::throw_exception(
- archive_exception(archive_exception::incompatible_native_format)
+ archive_exception(
+ archive_exception::incompatible_native_format,
+ "size of long"
+ )
         );
     this->This()->load(size);
     if(sizeof(float) != size)
         boost::serialization::throw_exception(
- archive_exception(archive_exception::incompatible_native_format)
+ archive_exception(
+ archive_exception::incompatible_native_format,
+ "size of float"
+ )
         );
     this->This()->load(size);
     if(sizeof(double) != size)
         boost::serialization::throw_exception(
- archive_exception(archive_exception::incompatible_native_format)
+ archive_exception(
+ archive_exception::incompatible_native_format,
+ "size of double"
+ )
         );
 
     // for checking endian
@@ -69,7 +81,10 @@
     this->This()->load(i);
     if(1 != i)
         boost::serialization::throw_exception(
- archive_exception(archive_exception::incompatible_native_format)
+ archive_exception(
+ archive_exception::incompatible_native_format,
+ "endian setting"
+ )
         );
 }
 
@@ -77,10 +92,10 @@
 BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
 basic_binary_iprimitive<Archive, Elem, Tr>::load(wchar_t * ws)
 {
- std::size_t l;
+ std::size_t l; // number of wchar_t !!!
     this->This()->load(l);
     load_binary(ws, l * sizeof(wchar_t) / sizeof(char));
- ws[l / sizeof(wchar_t)] = L'\0';
+ ws[l] = L'\0';
 }
 
 template<class Archive, class Elem, class Tr>

Modified: branches/release/boost/archive/impl/basic_xml_iarchive.ipp
==============================================================================
--- branches/release/boost/archive/impl/basic_xml_iarchive.ipp (original)
+++ branches/release/boost/archive/impl/basic_xml_iarchive.ipp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -13,7 +13,7 @@
 #include <algorithm>
 
 #include <boost/serialization/throw_exception.hpp>
-
+#include <boost/archive/xml_archive_exception.hpp>
 #include <boost/archive/basic_xml_iarchive.hpp>
 #include <boost/serialization/tracking.hpp>
 
@@ -67,7 +67,10 @@
             )
         ){
             boost::serialization::throw_exception(
- archive_exception(archive_exception::stream_error)
+ xml_archive_exception(
+ xml_archive_exception::xml_archive_tag_mismatch,
+ name
+ )
             );
         }
     }

Modified: branches/release/boost/archive/polymorphic_iarchive.hpp
==============================================================================
--- branches/release/boost/archive/polymorphic_iarchive.hpp (original)
+++ branches/release/boost/archive/polymorphic_iarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -18,15 +18,15 @@
 
 #include <cstddef> // std::size_t
 #include <climits> // ULONG_MAX
-#include <boost/config.hpp>
+#include <string>
 
+#include <boost/config.hpp>
 #if defined(BOOST_NO_STDC_NAMESPACE)
 namespace std{
     using ::size_t;
 } // namespace std
 #endif
 
-#include <string>
 #include <boost/cstdint.hpp>
 
 #include <boost/serialization/pfto.hpp>
@@ -166,6 +166,8 @@
 } // namespace archive
 } // namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive. We created a "mix-in"
 // class to provide this functionality. Since shared_ptr holds a
@@ -189,6 +191,4 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::polymorphic_iarchive)
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif // BOOST_ARCHIVE_POLYMORPHIC_IARCHIVE_HPP

Modified: branches/release/boost/archive/shared_ptr_helper.hpp
==============================================================================
--- branches/release/boost/archive/shared_ptr_helper.hpp (original)
+++ branches/release/boost/archive/shared_ptr_helper.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -24,11 +24,15 @@
 #include <boost/config.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <boost/type_traits/is_polymorphic.hpp>
 #include <boost/serialization/type_info_implementation.hpp>
 #include <boost/serialization/shared_ptr_132.hpp>
 #include <boost/serialization/throw_exception.hpp>
 
 #include <boost/archive/archive_exception.hpp>
+#include <boost/archive/detail/decl.hpp>
+
+#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost_132 {
     template<class T> class shared_ptr;
@@ -44,20 +48,15 @@
             const unsigned int file_version
         );
     }
-
 namespace archive{
 namespace detail {
 
-struct null_deleter {
- void operator()(void const *) const {}
-};
-
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // a common class for holding various types of shared pointers
 
 class shared_ptr_helper {
     typedef std::map<
- const void *,
+ void *,
         boost::shared_ptr<const void>
> collection_type;
     typedef collection_type::const_iterator iterator_type;
@@ -68,6 +67,10 @@
     // a "mix-in" even if shared_ptr isn't used.
     collection_type * m_pointers;
 
+ struct null_deleter {
+ void operator()(void const *) const {}
+ };
+
 #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 public:
 #else
@@ -91,6 +94,36 @@
     std::list<boost_132::shared_ptr<void> > * m_pointers_132;
 // #endif
 
+ typedef std::pair<const iterator_type, void *> result_type;
+
+ // returns pointer to object and an indicator whether this is a
+ // new entry (true) or a previous one (false)
+ BOOST_ARCHIVE_DECL(result_type) get_od(
+ void * od,
+ const boost::serialization::extended_type_info * true_type,
+ const boost::serialization::extended_type_info * this_type
+ );
+
+ template<class T>
+ struct non_polymorphic {
+ static const boost::serialization::extended_type_info *
+ get_object_identifier(T & t){
+ return boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance();
+ }
+ };
+ template<class T>
+ struct polymorphic {
+ static const boost::serialization::extended_type_info *
+ get_object_identifier(T & t){
+ return boost::serialization::singleton<
+ BOOST_DEDUCED_TYPENAME
+ boost::serialization::type_info_implementation<T>::type
+ >::get_const_instance().get_derived_extended_type_info(t);
+ }
+ };
 public:
     template<class T>
     void reset(shared_ptr<T> & s, T * t){
@@ -98,75 +131,57 @@
             s.reset();
             return;
         }
+ const boost::serialization::extended_type_info * this_type
+ = & boost::serialization::type_info_implementation<T>::type
+ ::get_const_instance();
+
         // get pointer to the most derived object. This is effectively
         // the object identifer
- const boost::serialization::extended_type_info * true_type
- = boost::serialization::type_info_implementation<T>::type
- ::get_const_instance().get_derived_extended_type_info(*t);
+ typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ is_polymorphic<T>,
+ mpl::identity<polymorphic<T> >,
+ mpl::identity<non_polymorphic<T> >
+ >::type type;
+
+ const boost::serialization::extended_type_info * true_type
+ = type::get_object_identifier(*t);
+
         // note:if this exception is thrown, be sure that derived pointer
         // is either registered or exported.
         if(NULL == true_type)
             boost::serialization::throw_exception(
- archive_exception(archive_exception::unregistered_class)
+ archive_exception(
+ archive_exception::unregistered_class,
+ this_type->get_debug_info()
+ )
             );
- const boost::serialization::extended_type_info * this_type
- = & boost::serialization::type_info_implementation<T>::type
- ::get_const_instance();
-
- // get void pointer to the most derived type
- // this uniquely identifies the object referred to
- const void * od = void_downcast(
- *true_type,
- *this_type,
- static_cast<const void *>(t)
+ result_type r =
+ get_od(
+ t,
+ true_type,
+ this_type
+ );
+ s = shared_ptr<T>(
+ r.first->second,
+ static_cast<T *>(r.second)
         );
-
- // make tracking array if necessary
- if(NULL == m_pointers)
- m_pointers = new collection_type;
-
- iterator_type it = m_pointers->find(od);
-
- // create a new shared pointer to a void
- if(it == m_pointers->end()){
- s.reset(t);
- shared_ptr<const void> sp(s, od);
- m_pointers->insert(collection_type::value_type(od, sp));
- return;
- }
- t = static_cast<T *>(const_cast<void *>(void_upcast(
- *true_type,
- *this_type,
- ((*it).second.get())
- )));
- s = shared_ptr<T>((*it).second, t); // aliasing
     }
+
 // #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
- void append(const boost_132::shared_ptr<void> & t){
- if(NULL == m_pointers_132)
- m_pointers_132 = new std::list<boost_132::shared_ptr<void> >;
- m_pointers_132->push_back(t);
- }
+ BOOST_ARCHIVE_DECL(void)
+ append(const boost_132::shared_ptr<void> & t);
 // #endif
 public:
- shared_ptr_helper() :
- m_pointers(NULL)
- #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
- , m_pointers_132(NULL)
- #endif
- {}
- ~shared_ptr_helper(){
- if(NULL != m_pointers)
- delete m_pointers;
- #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
- if(NULL != m_pointers_132)
- delete m_pointers_132;
- #endif
- }
+ BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
+ shared_ptr_helper();
+ BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
+ ~shared_ptr_helper();
 };
 
 } // namespace detail
-} // namespace serialization
+} // namespace archive
 } // namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 #endif // BOOST_ARCHIVE_SHARED_PTR_HELPER_HPP

Modified: branches/release/boost/archive/text_iarchive.hpp
==============================================================================
--- branches/release/boost/archive/text_iarchive.hpp (original)
+++ branches/release/boost/archive/text_iarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -84,8 +84,9 @@
     public text_iarchive_impl<naked_text_iarchive>
 {
 public:
- naked_text_iarchive(std::istream & is, unsigned int flags = 0) :
- text_iarchive_impl<naked_text_iarchive>(is, flags)
+ naked_text_iarchive(std::istream & is_, unsigned int flags = 0) :
+ // note: added _ to suppress useless gcc warning
+ text_iarchive_impl<naked_text_iarchive>(is_, flags)
     {}
     ~naked_text_iarchive(){}
 };
@@ -93,6 +94,8 @@
 } // namespace archive
 } // namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive. We created a "mix-in"
 // class to provide this functionality. Since shared_ptr holds a
@@ -107,8 +110,9 @@
     public detail::shared_ptr_helper
 {
 public:
- text_iarchive(std::istream & is, unsigned int flags = 0) :
- text_iarchive_impl<text_iarchive>(is, flags)
+ text_iarchive(std::istream & is_, unsigned int flags = 0) :
+ // note: added _ to suppress useless gcc warning
+ text_iarchive_impl<text_iarchive>(is_, flags)
     {}
     ~text_iarchive(){}
 };
@@ -119,6 +123,4 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_iarchive)
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif // BOOST_ARCHIVE_TEXT_IARCHIVE_HPP

Modified: branches/release/boost/archive/text_oarchive.hpp
==============================================================================
--- branches/release/boost/archive/text_oarchive.hpp (original)
+++ branches/release/boost/archive/text_oarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -83,8 +83,9 @@
 {
 public:
      
- text_oarchive(std::ostream & os, unsigned int flags = 0) :
- text_oarchive_impl<text_oarchive>(os, flags)
+ text_oarchive(std::ostream & os_, unsigned int flags = 0) :
+ // note: added _ to suppress useless gcc warning
+ text_oarchive_impl<text_oarchive>(os_, flags)
     {}
     ~text_oarchive(){}
 };

Modified: branches/release/boost/archive/text_wiarchive.hpp
==============================================================================
--- branches/release/boost/archive/text_wiarchive.hpp (original)
+++ branches/release/boost/archive/text_wiarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -91,6 +91,8 @@
 } // namespace archive
 } // namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive. We created a "mix-in"
 // class to provide this functionality. Since shared_ptr holds a
@@ -117,7 +119,5 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_wiarchive)
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif // BOOST_NO_STD_WSTREAMBUF
 #endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP

Modified: branches/release/boost/archive/xml_archive_exception.hpp
==============================================================================
--- branches/release/boost/archive/xml_archive_exception.hpp (original)
+++ branches/release/boost/archive/xml_archive_exception.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -20,6 +20,10 @@
 #include <cassert>
 
 #include <boost/archive/archive_exception.hpp>
+#include <boost/preprocessor/empty.hpp>
+#include <boost/archive/detail/decl.hpp>
+
+#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
 
 namespace boost {
 namespace archive {
@@ -27,7 +31,7 @@
 //////////////////////////////////////////////////////////////////////
 // exceptions thrown by xml archives
 //
-class xml_archive_exception :
+class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) xml_archive_exception :
     public virtual archive_exception
 {
 public:
@@ -36,31 +40,16 @@
         xml_archive_tag_mismatch,
         xml_archive_tag_name_error
     } exception_code;
- exception_code code;
- xml_archive_exception(exception_code)
- {}
- virtual const char *what( ) const throw( )
- {
- const char *msg;
- switch(code){
- case xml_archive_parsing_error:
- msg = "unrecognized XML syntax";
- break;
- case xml_archive_tag_mismatch:
- msg = "XML start/end tag mismatch";
- break;
- case xml_archive_tag_name_error:
- msg = "Invalid XML tag name";
- break;
- default:
- msg = archive_exception::what();
- break;
- }
- return msg;
- }
+ xml_archive_exception(
+ exception_code c,
+ const char * e1 = NULL,
+ const char * e2 = NULL
+ );
 };
 
 }// namespace archive
 }// namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 #endif //BOOST_XML_ARCHIVE_ARCHIVE_EXCEPTION_HPP

Modified: branches/release/boost/archive/xml_iarchive.hpp
==============================================================================
--- branches/release/boost/archive/xml_iarchive.hpp (original)
+++ branches/release/boost/archive/xml_iarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -102,6 +102,8 @@
 } // namespace archive
 } // namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive. We created a "mix-in"
 // class to provide this functionality. Since shared_ptr holds a
@@ -128,6 +130,4 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_iarchive)
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP

Modified: branches/release/boost/archive/xml_wiarchive.hpp
==============================================================================
--- branches/release/boost/archive/xml_wiarchive.hpp (original)
+++ branches/release/boost/archive/xml_wiarchive.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -106,6 +106,8 @@
 } // namespace archive
 } // namespace boost
 
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
 // note special treatment of shared_ptr. This type needs a special
 // structure associated with every archive. We created a "mix-in"
 // class to provide this functionality. Since shared_ptr holds a
@@ -132,7 +134,5 @@
 // required by export
 BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_wiarchive)
 
-#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
-
 #endif // BOOST_NO_STD_WSTREAMBUF
 #endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP

Modified: branches/release/boost/serialization/array.hpp
==============================================================================
--- branches/release/boost/serialization/array.hpp (original)
+++ branches/release/boost/serialization/array.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -43,7 +43,7 @@
 
 template<class T>
 class array
- : public wrapper_traits<array<T> >
+ : public wrapper_traits<const array<T> >
 {
 public:
     typedef T value_type;

Modified: branches/release/boost/serialization/binary_object.hpp
==============================================================================
--- branches/release/boost/serialization/binary_object.hpp (original)
+++ branches/release/boost/serialization/binary_object.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -36,7 +36,9 @@
 namespace boost {
 namespace serialization {
 
-struct binary_object {
+struct binary_object :
+ public wrapper_traits<nvp<const binary_object> >
+{
     /* const */ void * const m_t;
     const std::size_t m_size;
     template<class Archive>
@@ -69,28 +71,7 @@
     return binary_object(t, size);
 }
 
-// this is a wrapper
-
-template <>
-struct is_wrapper<binary_object>
- : public mpl::true_
-{};
-
 } // namespace serialization
 } // boost
 
-// don't need versioning info for this type
-BOOST_CLASS_IMPLEMENTATION(
- binary_object,
- boost::serialization::object_serializable
-)
-
-// don't track binary objects - usually they will be created on the stack
-// and tracking algorithm (which uses the object address) might get
-// confused. note that these address will likely be members of some
-// other structure which itself is tracked, so as a practical matter
-// suppressing tracking shouldn't cause any redundancy.
-
-BOOST_CLASS_TRACKING(binary_object, boost::serialization::track_never)
-
 #endif // BOOST_SERIALIZATION_BINARY_OBJECT_HPP

Modified: branches/release/boost/serialization/export.hpp
==============================================================================
--- branches/release/boost/serialization/export.hpp (original)
+++ branches/release/boost/serialization/export.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -29,20 +29,17 @@
 #include <boost/preprocessor/stringize.hpp>
 #include <boost/type_traits/is_polymorphic.hpp>
 
-#ifndef BOOST_SERIALIZATION_DEFAULT_TYPE_INFO
- #include <boost/serialization/extended_type_info_typeid.hpp>
-#endif
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/bool.hpp>
+
 #include <boost/serialization/static_warning.hpp>
-#include <boost/serialization/type_info_implementation.hpp>
 #include <boost/serialization/assume_abstract.hpp>
 #include <boost/serialization/force_include.hpp>
 #include <boost/serialization/singleton.hpp>
 
 #include <boost/archive/detail/register_archive.hpp>
-#include <boost/mpl/assert.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/mpl/bool.hpp>
 
 #include <iostream>
 
@@ -123,28 +120,22 @@
 template<class T>
 struct guid_initializer
 {
- const guid_initializer & export_guid(char const* /* key */, mpl::false_){
+ void export_guid(mpl::false_) const {
         // generates the statically-initialized objects whose constructors
         // register the information allowing serialization of T objects
         // through pointers to their base classes.
         instantiate_ptr_serialization((T*)0, 0, adl_tag());
- return *this;
     }
- const guid_initializer & export_guid(char const* /*key*/, mpl::true_){
- return *this;
+ const void export_guid(mpl::true_) const {
     }
- const guid_initializer & export_guid(char const* key){
+ guid_initializer const & export_guid() const {
         BOOST_STATIC_WARNING(boost::is_polymorphic<T>::value);
- assert(NULL != key);
- boost::serialization::singleton<
- BOOST_DEDUCED_TYPENAME
- boost::serialization::type_info_implementation<T>::type
- >::get_mutable_instance().key_register(key);
         // note: exporting an abstract base class will have no effect
         // and cannot be used to instantitiate serialization code
         // (one might be using this in a DLL to instantiate code)
         //BOOST_STATIC_WARNING(! boost::serialization::is_abstract<T>::value);
- return export_guid(key, boost::serialization::is_abstract<T>());
+ export_guid(boost::serialization::is_abstract<T>());
+ return *this;
     }
 };
 
@@ -156,22 +147,42 @@
 } // namespace archive
 } // namespace boost
 
+#define BOOST_CLASS_EXPORT_IMPLEMENT(T) \
+ namespace boost { \
+ namespace archive { \
+ namespace detail { \
+ namespace { \
+ template<> \
+ struct init_guid< T > { \
+ static guid_initializer< T > const & g; \
+ }; \
+ guid_initializer< T > const & init_guid< T >::g = \
+ ::boost::serialization::singleton< \
+ guid_initializer< T > \
+ >::get_mutable_instance().export_guid(); \
+ }}}} \
+/**/
+
+#define BOOST_CLASS_EXPORT_KEY2(T, K) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct guid_defined<T> : boost::mpl::true_ {}; \
+template<> \
+inline const char * guid<T>(){ \
+ return K; \
+} \
+} /* serialization */ \
+} /* boost */ \
+/**/
+
+#define BOOST_CLASS_EXPORT_KEY(T) \
+ BOOST_CLASS_EXPORT_KEY2(T, BOOST_PP_STRINGIZE(T)) \
+/**/
+
 #define BOOST_CLASS_EXPORT_GUID(T, K) \
- namespace boost { \
- namespace archive { \
- namespace detail { \
- namespace { \
- template<> \
- struct init_guid< T > { \
- static ::boost::archive::detail::guid_initializer< T > const \
- & guid_initializer; \
- }; \
- ::boost::archive::detail::guid_initializer< T > const & \
- ::boost::archive::detail::init_guid< T >::guid_initializer = \
- ::boost::serialization::singleton< \
- ::boost::archive::detail::guid_initializer< T > \
- >::get_mutable_instance().export_guid(K); \
- }}}} \
+BOOST_CLASS_EXPORT_KEY2(T, K) \
+BOOST_CLASS_EXPORT_IMPLEMENT(T) \
 /**/
 
 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
@@ -181,13 +192,13 @@
 // compiler we ask users to specifically register base/derived class
 // relationships for exported classes. On all other compilers, use of
 // this macro is entirely optional.
-# define BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(Base,Derived) \
-namespace { \
- static int BOOST_PP_CAT(boost_serialization_mwerks_init_, __LINE__) = \
- (::boost::archive::detail::instantiate_ptr_serialization((Derived*)0,0), 3); \
- static int BOOST_PP_CAT(boost_serialization_mwerks_init2_, __LINE__) = ( \
- ::boost::serialization::void_cast_register((Derived*)0,(Base*)0) \
- , 3); \
+# define BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(Base,Derived) \
+namespace { \
+ static int BOOST_PP_CAT(boost_serialization_mwerks_init_, __LINE__) = \
+ (::boost::archive::detail::instantiate_ptr_serialization((Derived*)0,0), 3); \
+ static int BOOST_PP_CAT(boost_serialization_mwerks_init2_, __LINE__) = ( \
+ ::boost::serialization::void_cast_register((Derived*)0,(Base*)0) \
+ , 3); \
 }
 
 #else

Modified: branches/release/boost/serialization/extended_type_info.hpp
==============================================================================
--- branches/release/boost/serialization/extended_type_info.hpp (original)
+++ branches/release/boost/serialization/extended_type_info.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -26,6 +26,7 @@
 #include <boost/serialization/config.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
+#include <boost/mpl/bool.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last header
 #ifdef BOOST_MSVC
@@ -37,11 +38,21 @@
 
 namespace boost {
 namespace serialization {
+
+namespace void_cast_detail{
+ class void_caster;
+}
+
 class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info :
     private boost::noncopyable
 {
-private:
+private:
+ friend class boost::serialization::void_cast_detail::void_caster;
     boost::shared_ptr<const extended_type_info> m_this;
+ boost::weak_ptr<const extended_type_info>
+ get_weak_ptr() const {
+ return m_this;
+ }
 
     // used to uniquely identify the type of class derived from this one
     // so that different derivations of this class can be simultaneously
@@ -49,13 +60,18 @@
     const unsigned int m_type_info_key;
     virtual bool is_less_than(const extended_type_info & /*rhs*/) const = 0;
     virtual bool is_equal(const extended_type_info & /*rhs*/) const = 0;
- void key_unregister();
-protected:
     const char * m_key;
+
+protected:
+ void key_unregister() const;
+ void key_register() const;
     // this class can't be used as is. It's just the
     // common functionality for all type_info replacement
     // systems. Hence, make these protected
- extended_type_info(const unsigned int type_info_key = 0);
+ extended_type_info(
+ const unsigned int type_info_key,
+ const char * key
+ );
     // account for bogus gcc warning
     #if defined(__GNUC__)
     virtual
@@ -65,16 +81,12 @@
     const char * get_key() const {
         return m_key;
     }
- void key_register(const char *key);
+ virtual const char * get_debug_info() const = 0;
     bool operator<(const extended_type_info &rhs) const;
     bool operator==(const extended_type_info &rhs) const;
     bool operator!=(const extended_type_info &rhs) const {
         return !(operator==(rhs));
     }
- boost::weak_ptr<const extended_type_info>
- get_weak_ptr() const {
- return m_this;
- }
     static const extended_type_info * find(const char *key);
     // for plugins
     virtual void * construct(unsigned int /*count*/ = 0, ...) const {
@@ -86,6 +98,13 @@
     }
 };
 
+template<class T>
+struct guid_defined : boost::mpl::false_ {};
+template<class T>
+inline const char * guid(){
+ return NULL;
+}
+
 } // namespace serialization
 } // namespace boost
 

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-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -22,9 +22,14 @@
 #include <boost/config.hpp>
 #include <boost/static_assert.hpp>
 
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+
+#include <boost/serialization/static_warning.hpp>
 #include <boost/serialization/singleton.hpp>
 #include <boost/serialization/extended_type_info.hpp>
 #include <boost/serialization/factory.hpp>
+#include <boost/serialization/throw_exception.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last header
 #ifdef BOOST_MSVC
@@ -38,7 +43,7 @@
 // define a special type_info that doesn't depend on rtti which is not
 // available in all situations.
 
-namespace detail {
+namespace no_rtti_system {
 
 // common base class to share type_info_key. This is used to
 // identify the method used to keep track of the extended type
@@ -46,7 +51,7 @@
     public extended_type_info
 {
 protected:
- extended_type_info_no_rtti_0();
+ extended_type_info_no_rtti_0(const char * key);
     ~extended_type_info_no_rtti_0();
 public:
     virtual bool
@@ -55,29 +60,66 @@
     is_equal(const boost::serialization::extended_type_info &rhs) const ;
 };
 
-} // detail
+} // no_rtti_system
 
 template<class T>
 class extended_type_info_no_rtti :
- public detail::extended_type_info_no_rtti_0,
+ public no_rtti_system::extended_type_info_no_rtti_0,
     public singleton<extended_type_info_no_rtti<T> >
 {
+ template<bool tf>
+ struct action {
+ struct defined {
+ static const char * invoke(){
+ return guid<T>();
+ }
+ };
+ struct undefined {
+ // if your program traps here - you failed to
+ // export a guid for this type. the no_rtti
+ // system requires export for types serialized
+ // as pointers.
+ BOOST_STATIC_ASSERT(0 == sizeof(T));
+ static const char * invoke();
+ };
+ static const char * invoke(){
+ typedef
+ BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ tf,
+ defined,
+ undefined
+ >::type type;
+ return type::invoke();
+ }
+ };
 public:
     extended_type_info_no_rtti() :
- detail::extended_type_info_no_rtti_0()
- {}
+ no_rtti_system::extended_type_info_no_rtti_0(get_key())
+ {
+ key_register();
+ }
+ ~extended_type_info_no_rtti(){
+ key_unregister();
+ }
     const extended_type_info *
     get_derived_extended_type_info(const T & t) const {
         // find the type that corresponds to the most derived type.
         // this implementation doesn't depend on typeid() but assumes
         // that the specified type has a function of the following signature.
         // A common implemention of such a function is to define as a virtual
- // function.
+ // function. So if the is not a polymporphic type it's likely an error
+ BOOST_STATIC_WARNING(boost::is_polymorphic<T>::value);
         const char * derived_key = t.get_key();
         assert(NULL != derived_key);
         return boost::serialization::extended_type_info::find(derived_key);
     }
- void * construct(unsigned int count, ...) const{
+ const char * get_key() const{
+ return action<guid_defined<T>::value >::invoke();
+ }
+ virtual const char * get_debug_info() const{
+ return action<guid_defined<T>::value >::invoke();
+ }
+ virtual void * construct(unsigned int count, ...) const{
         // count up the arguments
         std::va_list ap;
         va_start(ap, count);
@@ -98,7 +140,7 @@
             return NULL;
         }
     }
- void destroy(void const * const p) const{
+ virtual void destroy(void const * const p) const{
         delete static_cast<T const *>(p) ;
     }
 };

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-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -32,6 +32,8 @@
 #include <boost/serialization/extended_type_info.hpp>
 #include <boost/serialization/factory.hpp>
 
+#include <boost/mpl/if.hpp>
+
 #include <boost/config/abi_prefix.hpp> // must be the last header
 #ifdef BOOST_MSVC
 # pragma warning(push)
@@ -40,14 +42,17 @@
 
 namespace boost {
 namespace serialization {
-namespace detail {
+namespace typeid_system {
 
 class BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) extended_type_info_typeid_0 :
     public extended_type_info
 {
+ virtual const char * get_debug_info() const {
+ return m_ti->name();
+ }
 protected:
     const std::type_info * m_ti;
- extended_type_info_typeid_0();
+ extended_type_info_typeid_0(const char * key);
     ~extended_type_info_typeid_0();
     void type_register(const std::type_info & ti);
     void type_unregister();
@@ -63,20 +68,22 @@
     }
 };
 
-} // namespace detail
+} // typeid_system
 
 template<class T>
 class extended_type_info_typeid :
- public detail::extended_type_info_typeid_0,
+ public typeid_system::extended_type_info_typeid_0,
     public singleton<extended_type_info_typeid<T> >
 {
 public:
     extended_type_info_typeid() :
- detail::extended_type_info_typeid_0()
+ typeid_system::extended_type_info_typeid_0(get_key())
     {
         type_register(typeid(T));
+ key_register();
     }
     ~extended_type_info_typeid(){
+ key_unregister();
         type_unregister();
     }
     // get the eti record for the true type of this record
@@ -87,11 +94,14 @@
         // only does something if the class has at least one virtual function.
         BOOST_STATIC_WARNING(boost::is_polymorphic<T>::value);
         return
- detail::extended_type_info_typeid_0::get_extended_type_info(
+ typeid_system::extended_type_info_typeid_0::get_extended_type_info(
                 typeid(t)
             );
     }
- void * construct(unsigned int count, ...) const{
+ const char * get_key() const {
+ return boost::serialization::guid<T>();
+ }
+ virtual void * construct(unsigned int count, ...) const{
         // count up the arguments
         std::va_list ap;
         va_start(ap, count);
@@ -112,7 +122,7 @@
             return NULL;
         }
     }
- void destroy(void const * const /* p */) const {
+ virtual void destroy(void const * const /* p */) const {
         // the only current usage of extended type info is in the
         // serialization library. The statement below requires
         // that destructor of type T be public and this creates

Modified: branches/release/boost/serialization/level.hpp
==============================================================================
--- branches/release/boost/serialization/level.hpp (original)
+++ branches/release/boost/serialization/level.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -40,10 +40,10 @@
 
 // default serialization implementation level
 template<class T>
-struct implementation_level {
+struct implementation_level_impl {
     template<class U>
     struct traits_class_level {
- typedef BOOST_DEDUCED_TYPENAME U::level type;
+ typedef BOOST_DEDUCED_TYPENAME U::level type;
     };
 
     typedef mpl::integral_c_tag tag;
@@ -85,9 +85,14 @@
>
>::type type;
         // vc 7.1 doesn't like enums here
- BOOST_STATIC_CONSTANT(int, value = implementation_level::type::value);
+ BOOST_STATIC_CONSTANT(int, value = type::value);
 };
 
+template<class T>
+struct implementation_level :
+ public implementation_level_impl<const T>
+{
+};
 
 template<class T, BOOST_MPL_AUX_NTTP_DECL(int, L) >
 inline bool operator>=(implementation_level<T> t, enum level_type l)
@@ -104,13 +109,13 @@
     namespace boost { \
     namespace serialization { \
     template <> \
- struct implementation_level< T > \
+ struct implementation_level_impl< const T > \
     { \
         typedef mpl::integral_c_tag tag; \
         typedef mpl::int_< E > type; \
         BOOST_STATIC_CONSTANT( \
             int, \
- value = implementation_level::type::value \
+ value = implementation_level_impl::type::value \
         ); \
     }; \
     } \

Modified: branches/release/boost/serialization/nvp.hpp
==============================================================================
--- branches/release/boost/serialization/nvp.hpp (original)
+++ branches/release/boost/serialization/nvp.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -41,11 +41,12 @@
 template<class T>
 struct nvp :
     public std::pair<const char *, T *>,
- public wrapper_traits<nvp<T> >
+ public wrapper_traits<const nvp<T> >
 {
- explicit nvp(const char * name, T & t) :
+ explicit nvp(const char * name_, T & t) :
         // note: redundant cast works around borland issue
- std::pair<const char *, T *>(name, (T*)(& t))
+ // 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

Modified: branches/release/boost/serialization/serialization.hpp
==============================================================================
--- branches/release/boost/serialization/serialization.hpp (original)
+++ branches/release/boost/serialization/serialization.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -66,7 +66,7 @@
 
 BOOST_STRONG_TYPEDEF(unsigned int, version_type)
 
-// default implemenation - call the member function "serialize"
+// default implementation - call the member function "serialize"
 template<class Archive, class T>
 inline void serialize(
     Archive & ar, T & t, const BOOST_PFTO unsigned int file_version
@@ -88,7 +88,7 @@
 // load data required for construction and invoke constructor in place
 template<class Archive, class T>
 inline void load_construct_data(
- Archive & ar,
+ Archive & /*ar*/,
     T * t,
     const BOOST_PFTO unsigned int /*file_version*/
 ){

Modified: branches/release/boost/serialization/shared_ptr.hpp
==============================================================================
--- branches/release/boost/serialization/shared_ptr.hpp (original)
+++ branches/release/boost/serialization/shared_ptr.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -87,6 +87,10 @@
 namespace boost {
 namespace serialization{
 
+struct null_deleter {
+ void operator()(void const *) const {}
+};
+
 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
 // serialization for shared_ptr
 
@@ -121,7 +125,7 @@
         // boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter<T> > *
         //>(NULL));
         ar.register_type(static_cast<
- boost_132::detail::sp_counted_base_impl<T *, boost::archive::detail::null_deleter > *
+ boost_132::detail::sp_counted_base_impl<T *, null_deleter > *
>(NULL));
         boost_132::shared_ptr<T> sp;
         ar >> boost::serialization::make_nvp("px", sp.px);

Modified: branches/release/boost/serialization/static_warning.hpp
==============================================================================
--- branches/release/boost/serialization/static_warning.hpp (original)
+++ branches/release/boost/serialization/static_warning.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -62,128 +62,47 @@
 // W8073 is disabled by default. If enabling selected warnings is considered
 // unacceptable, this section can be replaced with:
 // #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x600)
-// pragma warn +stu
+// pragma warn +st
 // #endif
 
-# if defined(BOOST_MSVC)
-# pragma warning(2:4150) // C4150: deletion of pointer to incomplete type 'type'.
-# elif defined(BOOST_INTEL) && (defined(__WIN32__) || defined(WIN32))
-# pragma warning(2:457) // #457: delete of pointer to incomplete class.
-# elif defined(__BORLANDC__) && (__BORLANDC__ <= 0x600)
-# pragma warn +stu // W8073: Undefined structure 'structure'.
-# elif defined(__MWERKS__)
-# pragma extended_errorcheck on // Enable 'extended error checking'.
-# endif
-
-//------------------Configure-------------------------------------------------//
-# if defined(BOOST_INTEL)
-# elif defined(__PGI)
-# define BOOST_HAS_DESCRIPTIVE_DIVIDE_BY_ZERO_WARNING
-# elif defined(__GNUC__) && !defined(BOOST_INTEL) // && (__GNUC__ * 100 + __GNUC_MINOR__ <= 302)
-# define BOOST_HAS_DESCRIPTIVE_DIVIDE_BY_ZERO_WARNING
-# elif defined(__DECCXX) // for Tru64
-# define BOOST_HAS_DESCRIPTIVE_DIVIDE_BY_ZERO_WARNING
-# elif defined(__DMC__)
-# define BOOST_HAS_DESCRIPTIVE_RETURNING_ADDRESS_OF_TEMPORARY_WARNING
-# elif defined(BOOST_MSVC) // && (BOOST_MSVC < 1300)
-# define BOOST_NO_PREDEFINED_LINE_MACRO
-# pragma warning(disable:4094) // C4094: untagged 'struct' declared no symbols
-# else
-# define BOOST_HAS_DESCRIPTIVE_INCOMPLETE_TYPE_WARNING
-#endif
-
-//------------------Helper templates------------------------------------------//
+// 6. replaced implementation with one which depends solely on
+// mpl::print<>. The previous one was found to fail for functions
+// under recent versions of gcc and intel compilers - Robert Ramey
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/print.hpp>
+#include <boost/mpl/eval_if.hpp>
 
 namespace boost {
 namespace serialization {
 
-struct STATIC_WARNING;
-
-template<bool>
-struct static_warning_impl;
+template<int L>
+struct STATIC_WARNING_LINE{};
 
-template<>
-struct static_warning_impl<false> {
- enum { value = 0 };
- #if !defined(BOOST_HAS_DESCRIPTIVE_UNREFERENCED_VARIABLE_WARNING) && \
- !defined(BOOST_HAS_DESCRIPTIVE_RETURNING_ADDRESS_OF_TEMPORARY_WARNING)
- typedef boost::serialization::STATIC_WARNING type;
- #else
- typedef int type;
- #endif
- #if defined(BOOST_NO_PREDEFINED_LINE_MACRO)
- struct STATIC_WARNING { };
- #endif
+template<bool B, int L>
+struct static_warning_test{
+ typename boost::mpl::eval_if_c<
+ B,
+ boost::mpl::true_,
+ typename boost::mpl::identity<
+ boost::mpl::print<
+ STATIC_WARNING_LINE<L>
+ >
+ >
+ >::type type;
 };
 
-template<>
-struct static_warning_impl<true> {
- enum { value = 1 };
- struct type { type() { } int* operator&() { return new int; } };
- #if defined(BOOST_NO_PREDEFINED_LINE_MACRO)
- class STATIC_WARNING { };
- #endif
-};
+template<int i>
+struct SS {};
 
-} // namespace serialization
-} // namespace boost
+} // serialization
+} // boost
 
-//------------------Definition of BOOST_STATIC_WARNING------------------------//
+#define BSW(B, L) \
+ typedef boost::serialization::SS< \
+ sizeof( boost::serialization::static_warning_test< B, L > ) \
+ > BOOST_JOIN(STATIC_WARNING_LINE, L);
 
-#if defined(BOOST_HAS_DESCRIPTIVE_UNREFERENCED_VARIABLE_WARNING)
-# define BOOST_STATIC_WARNING_IMPL(B) \
- struct BOOST_JOIN(STATIC_WARNING, __LINE__) { \
- void f() { \
- ::boost::serialization::static_warning_impl<(bool)( B )>::type \
- STATIC_WARNING; \
- } \
- } \
- /**/
-#elif defined(BOOST_HAS_DESCRIPTIVE_RETURNING_ADDRESS_OF_TEMPORARY_WARNING)
-# define BOOST_STATIC_WARNING_IMPL(B) \
- struct BOOST_JOIN(STATIC_WARNING, __LINE__) { \
- int* f() { \
- ::boost::serialization::static_warning_impl<(bool)( B )>::type \
- STATIC_WARNING; \
- return &STATIC_WARNING; \
- } \
- } \
- /**/
-#elif defined(BOOST_HAS_DESCRIPTIVE_DIVIDE_BY_ZERO_WARNING)
-# define BOOST_STATIC_WARNING_IMPL(B) \
- struct BOOST_JOIN(STATIC_WARNING, __LINE__) { \
- int f() { \
- int STATIC_WARNING = 1; \
- return STATIC_WARNING / \
- boost::serialization::static_warning_impl<(bool)( B )>::value; } \
- } \
- /**/
-#elif defined(BOOST_NO_PREDEFINED_LINE_MACRO)
- // VC6; __LINE__ macro broken when -ZI is used see Q199057, so
- // non-conforming workaround is used.
-# define BOOST_STATIC_WARNING_IMPL(B) \
- struct BOOST_JOIN(STATIC_WARNING, __LINE__) { \
- struct S { \
- typedef boost::serialization::static_warning_impl<(bool)( B )> f; \
- friend class f::STATIC_WARNING; \
- }; \
- }; \
- /**/
-#elif defined(BOOST_HAS_DESCRIPTIVE_INCOMPLETE_TYPE_WARNING)
-# define BOOST_STATIC_WARNING_IMPL(B) \
- struct BOOST_JOIN(STATIC_WARNING, __LINE__) { \
- ::boost::serialization::static_warning_impl<(bool)( B )>::type* p; \
- void f() { delete p; } \
- } \
- /**/
-#else // not defined for this compiler
-# define BOOST_STATIC_WARNING_IMPL(B)
-#endif
-
-#ifndef BOOST_DISABLE_STATIC_WARNINGS
-# define BOOST_STATIC_WARNING(B) BOOST_STATIC_WARNING_IMPL(B)
-#else // #ifdef BOOST_ENABLE_STATIC_WARNINGS //-------------------------------//
-# define BOOST_STATIC_WARNING(B) BOOST_STATIC_WARNING_IMPL(true)
-#endif
+#define BOOST_STATIC_WARNING(B) BSW(B, __LINE__)
 
 #endif // BOOST_SERIALIZATION_STATIC_WARNING_HPP

Modified: branches/release/boost/serialization/tracking.hpp
==============================================================================
--- branches/release/boost/serialization/tracking.hpp (original)
+++ branches/release/boost/serialization/tracking.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -38,7 +38,7 @@
 
 // default tracking level
 template<class T>
-struct tracking_level {
+struct tracking_level_impl {
     template<class U>
     struct traits_class_tracking {
         typedef BOOST_DEDUCED_TYPENAME U::tracking type;
@@ -67,9 +67,14 @@
             // otherwise its selective
             mpl::int_<track_selectively>
> > >::type type;
- BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value);
+ BOOST_STATIC_CONSTANT(int, value = type::value);
 };
 
+template<class T>
+struct tracking_level :
+ public tracking_level_impl<const T>
+{
+};
 
 template<class T, enum tracking_type L>
 inline bool operator>=(tracking_level<T> t, enum tracking_type l)

Modified: branches/release/boost/serialization/vector.hpp
==============================================================================
--- branches/release/boost/serialization/vector.hpp (original)
+++ branches/release/boost/serialization/vector.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -21,6 +21,7 @@
 
 #include <boost/config.hpp>
 #include <boost/detail/workaround.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
 
 #include <boost/serialization/collections_save_imp.hpp>
 #include <boost/serialization/collections_load_imp.hpp>
@@ -30,8 +31,8 @@
 #include <boost/mpl/bool.hpp>
 
 // default is being compatible with version 1.34.1 files, not 1.35 files
-#ifndef BOOST_SERIALIZATION_VECTOR_VERSION
-#define BOOST_SERIALIZATION_VECTOR_VERSION 4
+#ifndef BOOST_SERIALIZATION_VECTOR_VERSIONED
+#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V==4 || V==5)
 #endif
 
 namespace boost {
@@ -82,8 +83,6 @@
 ){
     const collection_size_type count(t.size());
     ar << BOOST_SERIALIZATION_NVP(count);
- const unsigned int item_version = version<U>::value;
- ar << BOOST_SERIALIZATION_NVP(item_version);
     if (!t.empty())
         ar << make_array(detail::get_data(t),t.size());
 }
@@ -99,8 +98,9 @@
     ar >> BOOST_SERIALIZATION_NVP(count);
     t.resize(count);
     unsigned int item_version=0;
- if(BOOST_SERIALIZATION_VECTOR_VERSION < ar.get_library_version())
+ if(BOOST_SERIALIZATION_VECTOR_VERSIONED(ar.get_library_version())) {
         ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
     if (!t.empty())
         ar >> make_array(detail::get_data(t),t.size());
   }
@@ -126,6 +126,13 @@
     std::vector<U, Allocator> &t,
     const unsigned int file_version
 ){
+#ifdef BOOST_SERIALIZATION_VECTOR_135_HPP
+ if (ar.get_library_version()==5)
+ {
+ load(ar,t,file_version, boost::is_arithmetic<U>());
+ return;
+ }
+#endif
     typedef BOOST_DEDUCED_TYPENAME
     boost::serialization::use_array_optimization<Archive>::template apply<
         BOOST_DEDUCED_TYPENAME remove_const<U>::type

Modified: branches/release/boost/serialization/vector_135.hpp
==============================================================================
--- branches/release/boost/serialization/vector_135.hpp (original)
+++ branches/release/boost/serialization/vector_135.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -13,14 +13,12 @@
 #ifndef BOOST_SERIALIZATION_VECTOR_135_HPP
 #define BOOST_SERIALIZATION_VECTOR_135_HPP
 
-
-
-#ifdef BOOST_SERIALIZATION_VECTOR_VERSION
+#ifdef BOOST_SERIALIZATION_VECTOR_VERSIONED
 #if BOOST_SERIALIZATION_VECTOR_VERSION != 4
-#error Boost.Serialization cannot be compatible with both 1.34.1. and 1.35 files. Please include boost/serialization/vector_135.hpp before vector.hpp to be compatible with 1.35 files
+#error Boost.Serialization cannot be compatible with both 1.35 and 1.36-1.40 files
 #endif
 #else
-#define BOOST_SERIALIZATION_VECTOR_VERSION 4
+#define BOOST_SERIALIZATION_VECTOR_VERSIONED(V) (V==4)
 #endif
 
 #include <boost/serialization/vector.hpp>

Modified: branches/release/boost/serialization/version.hpp
==============================================================================
--- branches/release/boost/serialization/version.hpp (original)
+++ branches/release/boost/serialization/version.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -49,12 +49,24 @@
             traits_class_version<T>,
             mpl::int_<0>
>::type type;
- BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value);
+ BOOST_STATIC_CONSTANT(int, value = version::type::value);
 };
 
 } // namespace serialization
 } // namespace boost
 
+/* note: at first it seemed that this would be a good place to trap
+ * as an error an attempt to set a version # for a class which doesn't
+ * save its class information (including version #) in the archive.
+ * However, this imposes a requirement that the version be set after
+ * the implemention level which would be pretty confusing. If this
+ * is to be done, do this check in the input or output operators when
+ * ALL the serialization traits are available. Included the implementation
+ * here with this comment as a reminder not to do this!
+ */
+//#include <boost/serialization/level.hpp>
+//#include <boost/mpl/equal_to.hpp>
+
 // specify the current version number for the class
 #define BOOST_CLASS_VERSION(T, N) \
 namespace boost { \
@@ -65,18 +77,11 @@
     typedef mpl::int_<N> type; \
     typedef mpl::integral_c_tag tag; \
     BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value); \
- /* require that class info saved when versioning is used */ \
     /* \
     BOOST_STATIC_ASSERT(( \
- mpl::or_< \
- mpl::equal_to< \
- mpl::int_<0>, \
- mpl::int_<N> \
- >, \
- mpl::equal_to< \
- implementation_level<T>, \
- mpl::int_<object_class_info> \
- > \
+ mpl::equal_to< \
+ :implementation_level<T >, \
+ mpl::int_<object_class_info> \
>::value \
     )); \
     */ \

Modified: branches/release/boost/serialization/void_cast.hpp
==============================================================================
--- branches/release/boost/serialization/void_cast.hpp (original)
+++ branches/release/boost/serialization/void_cast.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -230,6 +230,22 @@
     recursive_unregister();
 }
 
+template <class Derived, class Base>
+struct void_caster_base :
+ public void_caster
+{
+ typedef
+ BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
+ mpl::identity<
+ void_cast_detail::void_caster_virtual_base<Derived, Base>
+ >
+ ,// else
+ mpl::identity<
+ void_cast_detail::void_caster_primitive<Derived, Base>
+ >
+ >::type type;
+};
+
 } // void_cast_detail
 
 // Register a base/derived pair. This indicates that it is possible
@@ -262,6 +278,12 @@
     return singleton<typex>::get_const_instance();
 }
 
+template<class Derived, class Base>
+class void_caster :
+ public void_cast_detail::void_caster_base<Derived, Base>::type
+{
+};
+
 } // namespace serialization
 } // namespace boost
 

Modified: branches/release/boost/serialization/wrapper.hpp
==============================================================================
--- branches/release/boost/serialization/wrapper.hpp (original)
+++ branches/release/boost/serialization/wrapper.hpp 2009-09-19 22:18:42 EDT (Sat, 19 Sep 2009)
@@ -9,6 +9,7 @@
 #include <boost/serialization/traits.hpp>
 #include <boost/type_traits/is_base_and_derived.hpp>
 #include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/bool.hpp>
 
 namespace boost { namespace serialization {
 
@@ -25,39 +26,35 @@
     unsigned int Version = 0,
     class ETII = extended_type_info_impl< T >
>
-struct wrapper_traits : public traits<T,Level,Tracking,Version,ETII,mpl::true_>
+struct wrapper_traits :
+ public traits<T,Level,Tracking,Version,ETII,mpl::true_>
 {};
 
-/// the is_wrapper type traits class.
-
-namespace detail {
-template <class T>
-struct is_wrapper_member
-{
- typedef BOOST_DEDUCED_TYPENAME T::is_wrapper type;
-};
-
-}
-
-
 template<class T>
-struct is_wrapper
- : mpl::eval_if<
- is_base_and_derived<basic_traits,T>,
- detail::is_wrapper_member<T>,
- mpl::false_
+struct is_wrapper_impl :
+ boost::mpl::eval_if<
+ boost::is_base_and_derived<basic_traits,T>,
+ boost::mpl::true_,
+ boost::mpl::false_
>::type
 {};
-
-} } // end namespace boost::serialization
 
-// A macro to define that a class is a wrapper
-#define BOOST_CLASS_IS_WRAPPER(T) \
-namespace boost { \
-namespace serialization { \
-template<> \
-struct is_wrapper< T > : mpl::true_ {}; \
-}}
+template<class T>
+struct is_wrapper {
+ typedef BOOST_DEDUCED_TYPENAME is_wrapper_impl<const T>::type type;
+};
 
+} // serialization
+} // boost
+
+// A macro to define that a class is a wrapper
+#define BOOST_CLASS_IS_WRAPPER(T) \
+namespace boost { \
+namespace serialization { \
+template<> \
+struct is_wrapper_impl<const T> : boost::mpl::true_ {}; \
+} \
+} \
+/**/
 
 #endif //BOOST_SERIALIZATION_WRAPPER_HPP


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