|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55790 - trunk/boost/serialization
From: ramey_at_[hidden]
Date: 2009-08-26 16:45:13
Author: ramey
Date: 2009-08-26 16:45:13 EDT (Wed, 26 Aug 2009)
New Revision: 55790
URL: http://svn.boost.org/trac/boost/changeset/55790
Log:
moved code from header to library to reduce code bloat
Text files modified:
trunk/boost/serialization/extended_type_info.hpp | 1 -
trunk/boost/serialization/extended_type_info_no_rtti.hpp | 9 ++++++---
trunk/boost/serialization/shared_ptr.hpp | 6 +++++-
3 files changed, 11 insertions(+), 5 deletions(-)
Modified: trunk/boost/serialization/extended_type_info.hpp
==============================================================================
--- trunk/boost/serialization/extended_type_info.hpp (original)
+++ trunk/boost/serialization/extended_type_info.hpp 2009-08-26 16:45:13 EDT (Wed, 26 Aug 2009)
@@ -36,7 +36,6 @@
#define BOOST_SERIALIZATION_MAX_KEY_SIZE 128
-
namespace boost {
namespace serialization {
Modified: trunk/boost/serialization/extended_type_info_no_rtti.hpp
==============================================================================
--- trunk/boost/serialization/extended_type_info_no_rtti.hpp (original)
+++ trunk/boost/serialization/extended_type_info_no_rtti.hpp 2009-08-26 16:45:13 EDT (Wed, 26 Aug 2009)
@@ -22,13 +22,15 @@
#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/mpl/if.hpp>
-
#include <boost/config/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
@@ -105,7 +107,8 @@
// 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);
Modified: trunk/boost/serialization/shared_ptr.hpp
==============================================================================
--- trunk/boost/serialization/shared_ptr.hpp (original)
+++ trunk/boost/serialization/shared_ptr.hpp 2009-08-26 16:45:13 EDT (Wed, 26 Aug 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);
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