summaryrefslogtreecommitdiff
path: root/boost/serialization
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/serialization
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/serialization')
-rw-r--r--boost/serialization/access.hpp2
-rw-r--r--boost/serialization/array.hpp30
-rw-r--r--boost/serialization/assume_abstract.hpp2
-rw-r--r--boost/serialization/base_object.hpp10
-rw-r--r--boost/serialization/binary_object.hpp2
-rw-r--r--boost/serialization/bitset.hpp2
-rw-r--r--boost/serialization/collection_traits.hpp2
-rw-r--r--boost/serialization/collections_load_imp.hpp28
-rw-r--r--boost/serialization/collections_save_imp.hpp22
-rw-r--r--boost/serialization/complex.hpp2
-rw-r--r--boost/serialization/deque.hpp2
-rw-r--r--boost/serialization/detail/get_data.hpp2
-rw-r--r--boost/serialization/detail/shared_count_132.hpp10
-rw-r--r--boost/serialization/detail/shared_ptr_132.hpp32
-rw-r--r--boost/serialization/detail/stack_constructor.hpp8
-rw-r--r--boost/serialization/ephemeral.hpp6
-rw-r--r--boost/serialization/export.hpp6
-rw-r--r--boost/serialization/extended_type_info.hpp2
-rw-r--r--boost/serialization/extended_type_info_no_rtti.hpp16
-rw-r--r--boost/serialization/extended_type_info_typeid.hpp14
-rw-r--r--boost/serialization/factory.hpp2
-rw-r--r--boost/serialization/force_include.hpp2
-rw-r--r--boost/serialization/forward_list.hpp102
-rw-r--r--boost/serialization/hash_collections_load_imp.hpp2
-rw-r--r--boost/serialization/hash_collections_save_imp.hpp8
-rw-r--r--boost/serialization/hash_map.hpp10
-rw-r--r--boost/serialization/hash_set.hpp10
-rw-r--r--boost/serialization/is_bitwise_serializable.hpp2
-rw-r--r--boost/serialization/level.hpp17
-rw-r--r--boost/serialization/level_enum.hpp2
-rw-r--r--boost/serialization/list.hpp2
-rw-r--r--boost/serialization/map.hpp2
-rw-r--r--boost/serialization/nvp.hpp8
-rw-r--r--boost/serialization/optional.hpp33
-rw-r--r--boost/serialization/pfto.hpp2
-rw-r--r--boost/serialization/priority_queue.hpp74
-rw-r--r--boost/serialization/queue.hpp74
-rw-r--r--boost/serialization/scoped_ptr.hpp2
-rw-r--r--boost/serialization/serialization.hpp4
-rw-r--r--boost/serialization/set.hpp2
-rw-r--r--boost/serialization/shared_ptr.hpp138
-rw-r--r--boost/serialization/shared_ptr_132.hpp2
-rw-r--r--boost/serialization/shared_ptr_helper.hpp211
-rw-r--r--boost/serialization/singleton.hpp2
-rw-r--r--boost/serialization/slist.hpp4
-rw-r--r--boost/serialization/smart_cast.hpp38
-rw-r--r--boost/serialization/split_free.hpp6
-rw-r--r--boost/serialization/split_member.hpp6
-rw-r--r--boost/serialization/stack.hpp74
-rw-r--r--boost/serialization/state_saver.hpp4
-rw-r--r--boost/serialization/static_warning.hpp6
-rw-r--r--boost/serialization/string.hpp2
-rw-r--r--boost/serialization/strong_typedef.hpp2
-rw-r--r--boost/serialization/throw_exception.hpp2
-rw-r--r--boost/serialization/tracking.hpp12
-rw-r--r--boost/serialization/tracking_enum.hpp2
-rw-r--r--boost/serialization/traits.hpp8
-rw-r--r--boost/serialization/type_info_implementation.hpp8
-rw-r--r--boost/serialization/unique_ptr.hpp68
-rw-r--r--boost/serialization/unordered_collections_load_imp.hpp74
-rw-r--r--boost/serialization/unordered_collections_save_imp.hpp86
-rw-r--r--boost/serialization/unordered_map.hpp231
-rw-r--r--boost/serialization/unordered_set.hpp216
-rw-r--r--boost/serialization/utility.hpp4
-rw-r--r--boost/serialization/valarray.hpp2
-rw-r--r--boost/serialization/variant.hpp16
-rw-r--r--boost/serialization/vector.hpp14
-rw-r--r--boost/serialization/version.hpp6
-rw-r--r--boost/serialization/void_cast.hpp12
-rw-r--r--boost/serialization/void_cast_fwd.hpp2
-rw-r--r--boost/serialization/weak_ptr.hpp45
-rw-r--r--boost/serialization/wrapper.hpp2
72 files changed, 1588 insertions, 277 deletions
diff --git a/boost/serialization/access.hpp b/boost/serialization/access.hpp
index 40256d6cd3..ec88ff5aca 100644
--- a/boost/serialization/access.hpp
+++ b/boost/serialization/access.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_ACCESS_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/array.hpp b/boost/serialization/array.hpp
index 3391a96f51..35c640ce45 100644
--- a/boost/serialization/array.hpp
+++ b/boost/serialization/array.hpp
@@ -6,10 +6,14 @@
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+
#include <iostream>
#include <cstddef> // std::size_t
-#include <cstddef>
-#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+#include <array>
+#endif
+
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
@@ -97,9 +101,9 @@ public:
template<class Archive>
void serialize(Archive &ar, const unsigned int version)
{
- typedef BOOST_DEDUCED_TYPENAME
+ typedef typename
boost::serialization::use_array_optimization<Archive>::template apply<
- BOOST_DEDUCED_TYPENAME remove_const< T >::type
+ typename remove_const< T >::type
>::type use_optimized;
serialize_optimized(ar,version,use_optimized());
}
@@ -128,12 +132,26 @@ array< T > make_array( T* t, std::size_t s){
return array< T >(t, s);
}
+// implement serialization for boost::array
template <class Archive, class T, std::size_t N>
void serialize(Archive& ar, boost::array<T,N>& a, const unsigned int /* version */)
{
- ar & boost::serialization::make_nvp("elems",a.elems);
+ ar & boost::serialization::make_nvp("elems", a.elems);
}
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+// implement serialization for std::array
+template <class Archive, class T, std::size_t N>
+void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */)
+{
+ ar & boost::serialization::make_nvp(
+ "elems",
+ *static_cast<T (*)[N]>(static_cast<void *>(a.data()))
+ );
+
+}
+#endif
+
} } // end namespace boost::serialization
#ifdef __BORLANDC__
@@ -145,7 +163,7 @@ namespace boost { namespace serialization { \
template <> struct use_array_optimization<Archive> { \
template <class ValueType> \
struct apply : boost::mpl::apply1<Archive::use_array_optimization \
- , BOOST_DEDUCED_TYPENAME boost::remove_const<ValueType>::type \
+ , typename boost::remove_const<ValueType>::type \
>::type {}; \
}; }}
#endif // __BORLANDC__
diff --git a/boost/serialization/assume_abstract.hpp b/boost/serialization/assume_abstract.hpp
index 4a8123a31d..a5cb2f55a4 100644
--- a/boost/serialization/assume_abstract.hpp
+++ b/boost/serialization/assume_abstract.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_ASSUME_ABSTRACT_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/base_object.hpp b/boost/serialization/base_object.hpp
index b840d25e99..562dbd5061 100644
--- a/boost/serialization/base_object.hpp
+++ b/boost/serialization/base_object.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_BASE_OBJECT_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -48,7 +48,7 @@ namespace detail
template<class B, class D>
struct base_cast
{
- typedef BOOST_DEDUCED_TYPENAME
+ typedef typename
mpl::if_<
is_const<D>,
const B,
@@ -74,7 +74,7 @@ namespace detail
}
};
static void const * invoke(){
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typedef typename mpl::eval_if<
is_polymorphic<Base>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
@@ -95,12 +95,12 @@ base_object(const Derived & d)
}
#else
template<class Base, class Derived>
-BOOST_DEDUCED_TYPENAME detail::base_cast<Base, Derived>::type &
+typename detail::base_cast<Base, Derived>::type &
base_object(Derived &d)
{
BOOST_STATIC_ASSERT(( is_base_and_derived<Base,Derived>::value));
BOOST_STATIC_ASSERT(! is_pointer<Derived>::value);
- typedef BOOST_DEDUCED_TYPENAME detail::base_cast<Base, Derived>::type type;
+ typedef typename detail::base_cast<Base, Derived>::type type;
detail::base_register<type, Derived>::invoke();
return access::cast_reference<type, Derived>(d);
}
diff --git a/boost/serialization/binary_object.hpp b/boost/serialization/binary_object.hpp
index cbc19f46f8..7e2307680e 100644
--- a/boost/serialization/binary_object.hpp
+++ b/boost/serialization/binary_object.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_BINARY_OBJECT_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/bitset.hpp b/boost/serialization/bitset.hpp
index 0e109ce29c..78f9bd7433 100644
--- a/boost/serialization/bitset.hpp
+++ b/boost/serialization/bitset.hpp
@@ -11,7 +11,7 @@
#define BOOST_SERIALIZATION_BITSET_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/collection_traits.hpp b/boost/serialization/collection_traits.hpp
index 60453c7939..b3fe843426 100644
--- a/boost/serialization/collection_traits.hpp
+++ b/boost/serialization/collection_traits.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/collections_load_imp.hpp b/boost/serialization/collections_load_imp.hpp
index 11b00cdb8b..2291e74226 100644
--- a/boost/serialization/collections_load_imp.hpp
+++ b/boost/serialization/collections_load_imp.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_COLLECTIONS_LOAD_IMP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -51,14 +51,14 @@ namespace stl {
template<class Archive, class Container>
struct archive_input_seq
{
- inline BOOST_DEDUCED_TYPENAME Container::iterator
+ inline typename Container::iterator
operator()(
Archive &ar,
Container &s,
const unsigned int v,
- BOOST_DEDUCED_TYPENAME Container::iterator hint
+ typename Container::iterator hint
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
@@ -72,18 +72,18 @@ struct archive_input_seq
template<class Archive, class Container>
struct archive_input_map
{
- inline BOOST_DEDUCED_TYPENAME Container::iterator
+ inline typename Container::iterator
operator()(
Archive &ar,
Container &s,
const unsigned int v,
- BOOST_DEDUCED_TYPENAME Container::iterator hint
+ typename Container::iterator hint
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
- BOOST_DEDUCED_TYPENAME Container::iterator result =
+ typename Container::iterator result =
s.insert(hint, t.reference());
// note: the following presumes that the map::value_type was NOT tracked
// in the archive. This is the usual case, but here there is no way
@@ -100,18 +100,18 @@ struct archive_input_map
template<class Archive, class Container>
struct archive_input_set
{
- inline BOOST_DEDUCED_TYPENAME Container::iterator
+ inline typename Container::iterator
operator()(
Archive &ar,
Container &s,
const unsigned int v,
- BOOST_DEDUCED_TYPENAME Container::iterator hint
+ typename Container::iterator hint
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
- BOOST_DEDUCED_TYPENAME Container::iterator result =
+ typename Container::iterator result =
s.insert(hint, t.reference());
ar.reset_object_address(& (* result), & t.reference());
return result;
@@ -138,12 +138,12 @@ template<class Archive, class Container, class InputFunction, class R>
inline void load_collection(Archive & ar, Container &s)
{
s.clear();
- collection_size_type count;
const boost::archive::library_version_type library_version(
ar.get_library_version()
);
// retrieve number of elements
item_version_type item_version(0);
+ collection_size_type count;
ar >> BOOST_SERIALIZATION_NVP(count);
if(boost::archive::library_version_type(3) < library_version){
ar >> BOOST_SERIALIZATION_NVP(item_version);
@@ -152,7 +152,7 @@ inline void load_collection(Archive & ar, Container &s)
R rx;
rx(s, count);
InputFunction ifunc;
- BOOST_DEDUCED_TYPENAME Container::iterator hint;
+ typename Container::iterator hint;
hint = s.begin();
while(count-- > 0){
hint = ifunc(ar, s, item_version, hint);
diff --git a/boost/serialization/collections_save_imp.hpp b/boost/serialization/collections_save_imp.hpp
index 5151c4b8b3..f3cabfcf3f 100644
--- a/boost/serialization/collections_save_imp.hpp
+++ b/boost/serialization/collections_save_imp.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_COLLECTIONS_SAVE_IMP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -34,14 +34,16 @@ namespace stl {
//
template<class Archive, class Container>
-inline void save_collection(Archive & ar, const Container &s)
+inline void save_collection(
+ Archive & ar,
+ const Container &s,
+ collection_size_type count)
{
+ ar << BOOST_SERIALIZATION_NVP(count);
// record number of elements
- collection_size_type count(s.size());
const item_version_type item_version(
- version<BOOST_DEDUCED_TYPENAME Container::value_type>::value
+ version<typename Container::value_type>::value
);
- ar << BOOST_SERIALIZATION_NVP(count);
#if 0
boost::archive::library_version_type library_version(
ar.get_library_version()
@@ -53,7 +55,7 @@ inline void save_collection(Archive & ar, const Container &s)
ar << BOOST_SERIALIZATION_NVP(item_version);
#endif
- BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin();
+ typename Container::const_iterator it = s.begin();
while(count-- > 0){
// note borland emits a no-op without the explicit namespace
boost::serialization::save_construct_data_adl(
@@ -65,6 +67,14 @@ inline void save_collection(Archive & ar, const Container &s)
}
}
+template<class Archive, class Container>
+inline void save_collection(Archive & ar, const Container &s)
+{
+ // record number of elements
+ collection_size_type count(s.size());
+ save_collection(ar, s, count);
+}
+
} // namespace stl
} // namespace serialization
} // namespace boost
diff --git a/boost/serialization/complex.hpp b/boost/serialization/complex.hpp
index 3e222e42a2..b4ef44cf97 100644
--- a/boost/serialization/complex.hpp
+++ b/boost/serialization/complex.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_COMPLEX_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/deque.hpp b/boost/serialization/deque.hpp
index 340d5feedc..7012902918 100644
--- a/boost/serialization/deque.hpp
+++ b/boost/serialization/deque.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_DEQUE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/detail/get_data.hpp b/boost/serialization/detail/get_data.hpp
index 3cbcb4a30c..da8921355f 100644
--- a/boost/serialization/detail/get_data.hpp
+++ b/boost/serialization/detail/get_data.hpp
@@ -9,7 +9,7 @@
#define BOOST_SERIALIZATION_DETAIL_GET_DATA_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/detail/shared_count_132.hpp b/boost/serialization/detail/shared_count_132.hpp
index c42355b1e9..a63e48849b 100644
--- a/boost/serialization/detail/shared_count_132.hpp
+++ b/boost/serialization/detail/shared_count_132.hpp
@@ -3,7 +3,7 @@
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -201,12 +201,12 @@ public:
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
-template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, checked_deleter< T > const &, int)
+template<class T> void cbi_call_constructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &, int)
{
boost::sp_scalar_constructor_hook(px, sizeof(T), pn);
}
-template<class T> void cbi_call_constructor_hook(sp_counted_base *, T * px, checked_array_deleter< T > const &, int)
+template<class T> void cbi_call_constructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &, int)
{
boost::sp_array_constructor_hook(px);
}
@@ -215,12 +215,12 @@ template<class P, class D> void cbi_call_constructor_hook(sp_counted_base *, P c
{
}
-template<class T> void cbi_call_destructor_hook(sp_counted_base * pn, T * px, checked_deleter< T > const &, int)
+template<class T> void cbi_call_destructor_hook(sp_counted_base * pn, T * px, boost::checked_deleter< T > const &, int)
{
boost::sp_scalar_destructor_hook(px, sizeof(T), pn);
}
-template<class T> void cbi_call_destructor_hook(sp_counted_base *, T * px, checked_array_deleter< T > const &, int)
+template<class T> void cbi_call_destructor_hook(sp_counted_base *, T * px, boost::checked_array_deleter< T > const &, int)
{
boost::sp_array_destructor_hook(px);
}
diff --git a/boost/serialization/detail/shared_ptr_132.hpp b/boost/serialization/detail/shared_ptr_132.hpp
index b5f2b21563..969b53a77b 100644
--- a/boost/serialization/detail/shared_ptr_132.hpp
+++ b/boost/serialization/detail/shared_ptr_132.hpp
@@ -114,7 +114,7 @@ public:
typedef T element_type;
typedef T value_type;
typedef T * pointer;
- typedef BOOST_DEDUCED_TYPENAME detail::shared_ptr_traits< T >::reference reference;
+ typedef typename detail::shared_ptr_traits< T >::reference reference;
shared_ptr(): px(0), pn() // never throws in 1.30+
{
@@ -353,17 +353,6 @@ template<class T, class U> inline bool operator!=(shared_ptr< T > const & a, sha
return a.get() != b.get();
}
-#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
-
-// Resolve the ambiguity between our op!= and the one in rel_ops
-
-template<class T> inline bool operator!=(shared_ptr< T > const & a, shared_ptr< T > const & b)
-{
- return a.get() != b.get();
-}
-
-#endif
-
template<class T, class U> inline bool operator<(shared_ptr< T > const & a, shared_ptr<U> const & b)
{
return a._internal_less(b);
@@ -421,33 +410,16 @@ template<class T> inline T * get_pointer(shared_ptr< T > const & p)
// operator<<
-#if defined(__GNUC__) && (__GNUC__ < 3)
-template<class Y> std::ostream & operator<< (std::ostream & os, shared_ptr<Y> const & p)
-{
- os << p.get();
- return os;
-}
-
-#else
-
-# if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1200 && __SGI_STL_PORT)
-// MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL
-using std::basic_ostream;
-template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, shared_ptr<Y> const & p)
-# else
template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p)
-# endif
{
os << p.get();
return os;
}
-#endif
-
// get_deleter (experimental)
-#if (defined(__GNUC__) && (__GNUC__ < 3)) || (defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238))
+#if defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238)
// g++ 2.9x doesn't allow static_cast<X const *>(void *)
// apparently EDG 2.38 also doesn't accept it
diff --git a/boost/serialization/detail/stack_constructor.hpp b/boost/serialization/detail/stack_constructor.hpp
index de623b0d4f..7c74c181a3 100644
--- a/boost/serialization/detail/stack_constructor.hpp
+++ b/boost/serialization/detail/stack_constructor.hpp
@@ -2,14 +2,10 @@
#define BOOST_SERIALIZATION_DETAIL_STACH_CONSTRUCTOR_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
-#if defined(_MSC_VER) && (_MSC_VER <= 1020)
-# pragma warning (disable : 4786) // too long name, harmless warning
-#endif
-
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// collections_load_imp.hpp: serialization for loading stl collections
@@ -38,7 +34,7 @@ struct stack_allocate
return * address();
}
private:
- typedef BOOST_DEDUCED_TYPENAME boost::aligned_storage<
+ typedef typename boost::aligned_storage<
sizeof(T),
#if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x560))
8
diff --git a/boost/serialization/ephemeral.hpp b/boost/serialization/ephemeral.hpp
index f559bec99f..b913fef0b2 100644
--- a/boost/serialization/ephemeral.hpp
+++ b/boost/serialization/ephemeral.hpp
@@ -3,7 +3,7 @@
// MS compatible compilers support
#pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -21,10 +21,6 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
-// supress noise
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
-# pragma warning (disable : 4786) // too long name, harmless warning
-#endif
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c_tag.hpp>
diff --git a/boost/serialization/export.hpp b/boost/serialization/export.hpp
index 6b29556aaf..99354782aa 100644
--- a/boost/serialization/export.hpp
+++ b/boost/serialization/export.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_EXPORT_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -103,14 +103,14 @@ ptr_serialization_support<Archive,Serializable>::instantiate()
{
export_impl<Archive,Serializable>::enable_save(
#if ! defined(__BORLANDC__)
- BOOST_DEDUCED_TYPENAME
+ typename
#endif
Archive::is_saving()
);
export_impl<Archive,Serializable>::enable_load(
#if ! defined(__BORLANDC__)
- BOOST_DEDUCED_TYPENAME
+ typename
#endif
Archive::is_loading()
);
diff --git a/boost/serialization/extended_type_info.hpp b/boost/serialization/extended_type_info.hpp
index a4b4b69319..d4b57afa61 100644
--- a/boost/serialization/extended_type_info.hpp
+++ b/boost/serialization/extended_type_info.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_EXTENDED_TYPE_INFO_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/extended_type_info_no_rtti.hpp b/boost/serialization/extended_type_info_no_rtti.hpp
index 025b3f6964..62b2473811 100644
--- a/boost/serialization/extended_type_info_no_rtti.hpp
+++ b/boost/serialization/extended_type_info_no_rtti.hpp
@@ -3,7 +3,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -89,7 +89,7 @@ class extended_type_info_no_rtti :
};
static const char * invoke(){
typedef
- BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ typename boost::mpl::if_c<
tf,
defined,
undefined
@@ -130,15 +130,15 @@ public:
va_start(ap, count);
switch(count){
case 0:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 0>(ap);
+ return factory<typename boost::remove_const< T >::type, 0>(ap);
case 1:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 1>(ap);
+ return factory<typename boost::remove_const< T >::type, 1>(ap);
case 2:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 2>(ap);
+ return factory<typename boost::remove_const< T >::type, 2>(ap);
case 3:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 3>(ap);
+ return factory<typename boost::remove_const< T >::type, 3>(ap);
case 4:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 4>(ap);
+ return factory<typename boost::remove_const< T >::type, 4>(ap);
default:
BOOST_ASSERT(false); // too many arguments
// throw exception here?
@@ -167,7 +167,7 @@ public:
namespace serialization {
template<class T>
struct extended_type_info_impl {
- typedef BOOST_DEDUCED_TYPENAME
+ typedef typename
boost::serialization::extended_type_info_no_rtti< T > type;
};
} // namespace serialization
diff --git a/boost/serialization/extended_type_info_typeid.hpp b/boost/serialization/extended_type_info_typeid.hpp
index 9f09587d67..6a003be1a0 100644
--- a/boost/serialization/extended_type_info_typeid.hpp
+++ b/boost/serialization/extended_type_info_typeid.hpp
@@ -3,7 +3,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -114,15 +114,15 @@ public:
va_start(ap, count);
switch(count){
case 0:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 0>(ap);
+ return factory<typename boost::remove_const< T >::type, 0>(ap);
case 1:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 1>(ap);
+ return factory<typename boost::remove_const< T >::type, 1>(ap);
case 2:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 2>(ap);
+ return factory<typename boost::remove_const< T >::type, 2>(ap);
case 3:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 3>(ap);
+ return factory<typename boost::remove_const< T >::type, 3>(ap);
case 4:
- return factory<BOOST_DEDUCED_TYPENAME boost::remove_const< T >::type, 4>(ap);
+ return factory<typename boost::remove_const< T >::type, 4>(ap);
default:
BOOST_ASSERT(false); // too many arguments
// throw exception here?
@@ -150,7 +150,7 @@ public:
namespace serialization {
template<class T>
struct extended_type_info_impl {
- typedef BOOST_DEDUCED_TYPENAME
+ typedef typename
boost::serialization::extended_type_info_typeid< T > type;
};
} // namespace serialization
diff --git a/boost/serialization/factory.hpp b/boost/serialization/factory.hpp
index a25bf204fd..b601af6268 100644
--- a/boost/serialization/factory.hpp
+++ b/boost/serialization/factory.hpp
@@ -3,7 +3,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/force_include.hpp b/boost/serialization/force_include.hpp
index 5578ee81d6..468be37fe8 100644
--- a/boost/serialization/force_include.hpp
+++ b/boost/serialization/force_include.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_FORCE_INCLUDE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/forward_list.hpp b/boost/serialization/forward_list.hpp
new file mode 100644
index 0000000000..6efa870048
--- /dev/null
+++ b/boost/serialization/forward_list.hpp
@@ -0,0 +1,102 @@
+#ifndef BOOST_SERIALIZATION_FORWARD_LIST_HPP
+#define BOOST_SERIALIZATION_FORWARD_LIST_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// forward_list.hpp
+
+// (C) Copyright 2002 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <cstddef> // size_t
+#include <forward_list>
+#include <iterator> // distance
+
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+
+#include <boost/serialization/collections_save_imp.hpp>
+#include <boost/serialization/collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/nvp.hpp>
+
+namespace boost {
+namespace serialization {
+
+template<class Archive, class U, class Allocator>
+inline void save(
+ Archive & ar,
+ const std::forward_list<U, Allocator> &t,
+ const unsigned int file_version
+){
+ const collection_size_type count(std::distance(t.cbegin(), t.cend()));
+ boost::serialization::stl::save_collection<
+ Archive,
+ std::forward_list<U, Allocator>
+ >(ar, t, count);
+}
+
+template<class Archive, class U, class Allocator>
+inline void load(
+ Archive & ar,
+ std::forward_list<U, Allocator> &t,
+ const unsigned int file_version
+){
+ t.clear();
+ // retrieve number of elements
+ collection_size_type count;
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ if(collection_size_type(0) == count)
+ return;
+ item_version_type item_version(0);
+ const boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ boost::serialization::detail::stack_construct<Archive, U> u(ar, item_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ t.push_front(u.reference());
+ typename std::forward_list<U, Allocator>::iterator last;
+ last = t.begin();
+ while(--count > 0){
+ boost::serialization::detail::stack_construct<Archive, U>
+ u(ar, file_version);
+ ar >> boost::serialization::make_nvp("item", u.reference());
+ last = t.insert_after(last, u.reference());
+ ar.reset_object_address(& (*last), & u.reference());
+ }
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class U, class Allocator>
+inline void serialize(
+ Archive & ar,
+ std::forward_list<U, Allocator> &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(std::forward_list)
+
+#endif // BOOST_SERIALIZATION_FORWARD_LIST_HPP
diff --git a/boost/serialization/hash_collections_load_imp.hpp b/boost/serialization/hash_collections_load_imp.hpp
index c064c9f27c..de85fd3fd2 100644
--- a/boost/serialization/hash_collections_load_imp.hpp
+++ b/boost/serialization/hash_collections_load_imp.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_HASH_COLLECTIONS_LOAD_IMP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
# pragma warning (disable : 4786) // too long name, harmless warning
#endif
diff --git a/boost/serialization/hash_collections_save_imp.hpp b/boost/serialization/hash_collections_save_imp.hpp
index 8d1fecec5e..65dfe83f16 100644
--- a/boost/serialization/hash_collections_save_imp.hpp
+++ b/boost/serialization/hash_collections_save_imp.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_HASH_COLLECTIONS_SAVE_IMP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -39,7 +39,7 @@ inline void save_hash_collection(Archive & ar, const Container &s)
collection_size_type count(s.size());
const collection_size_type bucket_count(s.bucket_count());
const item_version_type item_version(
- version<BOOST_DEDUCED_TYPENAME Container::value_type>::value
+ version<typename Container::value_type>::value
);
#if 0
@@ -76,14 +76,14 @@ inline void save_hash_collection(Archive & ar, const Container &s)
ar << BOOST_SERIALIZATION_NVP(item_version);
#endif
- BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin();
+ typename Container::const_iterator it = s.begin();
while(count-- > 0){
// note borland emits a no-op without the explicit namespace
boost::serialization::save_construct_data_adl(
ar,
&(*it),
boost::serialization::version<
- BOOST_DEDUCED_TYPENAME Container::value_type
+ typename Container::value_type
>::value
);
ar << boost::serialization::make_nvp("item", *it++);
diff --git a/boost/serialization/hash_map.hpp b/boost/serialization/hash_map.hpp
index f5327388aa..615ace8d8a 100644
--- a/boost/serialization/hash_map.hpp
+++ b/boost/serialization/hash_map.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_HASH_MAP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -40,11 +40,11 @@ struct archive_input_hash_map
Container &s,
const unsigned int v
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
- std::pair<BOOST_DEDUCED_TYPENAME Container::const_iterator, bool> result =
+ std::pair<typename Container::const_iterator, bool> result =
s.insert(t.reference());
// note: the following presumes that the map::value_type was NOT tracked
// in the archive. This is the usual case, but here there is no way
@@ -67,11 +67,11 @@ struct archive_input_hash_multimap
Container &s,
const unsigned int v
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
- BOOST_DEDUCED_TYPENAME Container::const_iterator result
+ typename Container::const_iterator result
= s.insert(t.reference());
// note: the following presumes that the map::value_type was NOT tracked
// in the archive. This is the usual case, but here there is no way
diff --git a/boost/serialization/hash_set.hpp b/boost/serialization/hash_set.hpp
index 916c2dd146..6275e0309e 100644
--- a/boost/serialization/hash_set.hpp
+++ b/boost/serialization/hash_set.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_HASH_SET_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -38,11 +38,11 @@ struct archive_input_hash_set
Container &s,
const unsigned int v
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
- std::pair<BOOST_DEDUCED_TYPENAME Container::const_iterator, bool> result =
+ std::pair<typename Container::const_iterator, bool> result =
s.insert(t.reference());
if(result.second)
ar.reset_object_address(& (* result.first), & t.reference());
@@ -58,11 +58,11 @@ struct archive_input_hash_multiset
Container &s,
const unsigned int v
){
- typedef BOOST_DEDUCED_TYPENAME Container::value_type type;
+ typedef typename Container::value_type type;
detail::stack_construct<Archive, type> t(ar, v);
// borland fails silently w/o full namespace
ar >> boost::serialization::make_nvp("item", t.reference());
- BOOST_DEDUCED_TYPENAME Container::const_iterator result
+ typename Container::const_iterator result
= s.insert(t.reference());
ar.reset_object_address(& (* result), & t.reference());
}
diff --git a/boost/serialization/is_bitwise_serializable.hpp b/boost/serialization/is_bitwise_serializable.hpp
index 34eec40ec4..dac597ec2c 100644
--- a/boost/serialization/is_bitwise_serializable.hpp
+++ b/boost/serialization/is_bitwise_serializable.hpp
@@ -17,7 +17,7 @@
#define BOOST_SERIALIZATION_IS_BITWISE_SERIALIZABLE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/level.hpp b/boost/serialization/level.hpp
index ce507b2281..b037f7ebc7 100644
--- a/boost/serialization/level.hpp
+++ b/boost/serialization/level.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_LEVEL_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -29,7 +29,6 @@
#include <boost/mpl/int.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c_tag.hpp>
-#include <boost/mpl/aux_/nttp_decl.hpp>
#include <boost/serialization/level_enum.hpp>
@@ -43,26 +42,26 @@ template<class T>
struct implementation_level_impl {
template<class U>
struct traits_class_level {
- typedef BOOST_DEDUCED_TYPENAME U::level type;
+ typedef typename U::level type;
};
typedef mpl::integral_c_tag tag;
// note: at least one compiler complained w/o the full qualification
// on basic traits below
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_base_and_derived<boost::serialization::basic_traits, T>,
traits_class_level< T >,
//else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_fundamental< T >,
mpl::int_<primitive_type>,
//else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_class< T >,
mpl::int_<object_class_info>,
//else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_array< T >,
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
mpl::int_<not_serializable>,
@@ -70,7 +69,7 @@ struct implementation_level_impl {
mpl::int_<object_serializable>,
#endif
//else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_enum< T >,
//#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x560))
// mpl::int_<not_serializable>,
@@ -94,7 +93,7 @@ struct implementation_level :
{
};
-template<class T, BOOST_MPL_AUX_NTTP_DECL(int, L) >
+template<class T, int L>
inline bool operator>=(implementation_level< T > t, enum level_type l)
{
return t.value >= (int)l;
diff --git a/boost/serialization/level_enum.hpp b/boost/serialization/level_enum.hpp
index 11bd17f67d..baf64e04f3 100644
--- a/boost/serialization/level_enum.hpp
+++ b/boost/serialization/level_enum.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_LEVEL_ENUM_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/list.hpp b/boost/serialization/list.hpp
index 469bb230ec..63d3b472b1 100644
--- a/boost/serialization/list.hpp
+++ b/boost/serialization/list.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_LIST_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/map.hpp b/boost/serialization/map.hpp
index 624290df1a..11a3d6bbc8 100644
--- a/boost/serialization/map.hpp
+++ b/boost/serialization/map.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_MAP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/nvp.hpp b/boost/serialization/nvp.hpp
index 2d7f4edd0f..f33707c305 100644
--- a/boost/serialization/nvp.hpp
+++ b/boost/serialization/nvp.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_NVP_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -20,10 +20,6 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
-// supress noise
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
-# pragma warning (disable : 4786) // too long name, harmless warning
-#endif
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c_tag.hpp>
@@ -104,7 +100,6 @@ nvp< T > make_nvp(const char * name, T & t){
// Partial Template Specialization and doing so would mean that wrappers
// wouldn't be treated the same on different platforms. This would
// break archive portability. Leave this here as reminder not to use it !!!
-#if 0 // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct implementation_level<nvp< T > >
@@ -123,7 +118,6 @@ struct tracking_level<nvp< T > >
BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value);
};
-#endif
} // seralization
} // boost
diff --git a/boost/serialization/optional.hpp b/boost/serialization/optional.hpp
index 929fa0749c..4024cf5e61 100644
--- a/boost/serialization/optional.hpp
+++ b/boost/serialization/optional.hpp
@@ -10,7 +10,7 @@
#ifndef BOOST_SERIALIZATION_OPTIONAL_HPP_
#define BOOST_SERIALIZATION_OPTIONAL_HPP_
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -90,37 +90,6 @@ void serialize(
boost::serialization::split_free(ar, t, version);
}
-// the following would be slightly more efficient. But it
-// would mean that archives created with programs that support
-// TPS wouldn't be readable by programs that don't support TPS.
-// Hence we decline to support this otherwise convenient optimization.
-//#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#if 0
-
-template <class T>
-struct implementation_level<optional< T > >
-{
- typedef mpl::integral_c_tag tag;
- typedef mpl::int_<boost::serialization::object_serializable> type;
- BOOST_STATIC_CONSTANT(
- int ,
- value = boost::serialization::implementation_level::type::value
- );
-};
-
-template<class T>
-struct tracking_level<optional< T > >
-{
- typedef mpl::integral_c_tag tag;
- typedef mpl::int_<boost::serialization::track_never> type;
- BOOST_STATIC_CONSTANT(
- int ,
- value = boost::serialization::tracking_level::type::value
- );
-};
-
-#endif
-
} // serialization
} // namespace boost
diff --git a/boost/serialization/pfto.hpp b/boost/serialization/pfto.hpp
index 8d984630ec..0370d2831f 100644
--- a/boost/serialization/pfto.hpp
+++ b/boost/serialization/pfto.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_PFTO_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/priority_queue.hpp b/boost/serialization/priority_queue.hpp
new file mode 100644
index 0000000000..3ba63a5b2d
--- /dev/null
+++ b/boost/serialization/priority_queue.hpp
@@ -0,0 +1,74 @@
+#ifndef BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP
+#define BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// priority_queue.hpp
+
+// (C) Copyright 2002 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <queue>
+#include <boost/config.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+namespace detail{
+
+template <typename U, typename Container, typename Compare>
+struct priority_queue_save : public STD::priority_queue<U, Container, Compare> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) const {
+ save(ar, STD::priority_queue<U, Container, Compare>::c, file_version);
+ }
+};
+template <typename U, typename Container, typename Compare>
+struct priority_queue_load : public STD::priority_queue<U, Container, Compare> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) {
+ load(ar, STD::priority_queue<U, Container, Compare>::c, file_version);
+ }
+};
+
+} // detail
+
+template<class Archive, class T, class Container, class Compare>
+inline void serialize(
+ Archive & ar,
+ std::priority_queue< T, Container, Compare> & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::priority_queue_save<T, Container, Compare> >,
+ mpl::identity<detail::priority_queue_load<T, Container, Compare> >
+ >::type typex;
+ static_cast<typex &>(t)(ar, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::priority_queue)
+
+#undef STD
+
+#endif // BOOST_SERIALIZATION_PRIORITY_QUEUE_HPP
diff --git a/boost/serialization/queue.hpp b/boost/serialization/queue.hpp
new file mode 100644
index 0000000000..58e1ee92f4
--- /dev/null
+++ b/boost/serialization/queue.hpp
@@ -0,0 +1,74 @@
+#ifndef BOOST_SERIALIZATION_QUEUE_HPP
+#define BOOST_SERIALIZATION_QUEUE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// queue.hpp
+
+// (C) Copyright 2014 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <queue>
+#include <boost/config.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+namespace detail {
+
+template <typename U, typename C>
+struct queue_save : public STD::queue<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) const {
+ save(ar, STD::queue<U, C>::c, file_version);
+ }
+};
+template <typename U, typename C>
+struct queue_load : public STD::queue<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) {
+ load(ar, STD::queue<U, C>::c, file_version);
+ }
+};
+
+} // detail
+
+template<class Archive, class T, class C>
+inline void serialize(
+ Archive & ar,
+ std::queue< T, C> & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::queue_save<T, C> >,
+ mpl::identity<detail::queue_load<T, C> >
+ >::type typex;
+ static_cast<typex &>(t)(ar, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::queue)
+
+#undef STD
+
+#endif // BOOST_SERIALIZATION_QUEUE_HPP
diff --git a/boost/serialization/scoped_ptr.hpp b/boost/serialization/scoped_ptr.hpp
index ef522d8cea..0d11f8436e 100644
--- a/boost/serialization/scoped_ptr.hpp
+++ b/boost/serialization/scoped_ptr.hpp
@@ -1,7 +1,7 @@
#ifndef BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
#define BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/serialization.hpp b/boost/serialization/serialization.hpp
index f17e8dd800..8462b594c8 100644
--- a/boost/serialization/serialization.hpp
+++ b/boost/serialization/serialization.hpp
@@ -2,11 +2,11 @@
#define BOOST_SERIALIZATION_SERIALIZATION_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1310)
+#if defined(_MSC_VER)
# pragma warning (disable : 4675) // suppress ADL warning
#endif
diff --git a/boost/serialization/set.hpp b/boost/serialization/set.hpp
index 4bb69abb93..6882fb040b 100644
--- a/boost/serialization/set.hpp
+++ b/boost/serialization/set.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SET_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/shared_ptr.hpp b/boost/serialization/shared_ptr.hpp
index 37f95e35a1..345aae961c 100644
--- a/boost/serialization/shared_ptr.hpp
+++ b/boost/serialization/shared_ptr.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SHARED_PTR_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -17,6 +17,7 @@
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
+#include <memory>
#include <boost/config.hpp>
#include <boost/mpl/integral_c.hpp>
@@ -25,13 +26,14 @@
#include <boost/detail/workaround.hpp>
#include <boost/shared_ptr.hpp>
+#include <boost/serialization/shared_ptr_helper.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/version.hpp>
#include <boost/serialization/tracking.hpp>
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// shared_ptr serialization traits
+// boost:: shared_ptr serialization traits
// version 1 to distinguish from boost 1.32 version. Note: we can only do this
// for a template when the compiler supports partial template specialization
@@ -42,7 +44,7 @@
struct version< ::boost::shared_ptr< T > > {
typedef mpl::integral_c_tag tag;
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
- typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type;
+ typedef typename mpl::int_<1> type;
#else
typedef mpl::int_<1> type;
#endif
@@ -57,7 +59,7 @@
struct tracking_level< ::boost::shared_ptr< T > > {
typedef mpl::integral_c_tag tag;
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
- typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type;
+ typedef typename mpl::int_< ::boost::serialization::track_never> type;
#else
typedef mpl::int_< ::boost::serialization::track_never> type;
#endif
@@ -91,7 +93,12 @@ struct null_deleter {
};
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// serialization for shared_ptr
+// serialization for boost::shared_ptr
+
+// Using a constant means that all shared pointers are held in the same set.
+// Thus we detect handle multiple pointers to the same value instances
+// in the archive.
+void * const shared_ptr_helper_id = 0;
template<class Archive, class T>
inline void save(
@@ -114,15 +121,11 @@ inline void load(
boost::shared_ptr< T > &t,
const unsigned int file_version
){
- // The most common cause of trapping here would be serializing
// something like shared_ptr<int>. This occurs because int
// is never tracked by default. Wrap int in a trackable type
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
T* r;
if(file_version < 1){
- //ar.register_type(static_cast<
- // 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 *, null_deleter > *
>(NULL));
@@ -130,16 +133,24 @@ inline void load(
ar >> boost::serialization::make_nvp("px", sp.px);
ar >> boost::serialization::make_nvp("pn", sp.pn);
// got to keep the sps around so the sp.pns don't disappear
- ar.append(sp);
+ boost::serialization::shared_ptr_helper<boost::shared_ptr> & h =
+ ar.template get_helper< shared_ptr_helper<boost::shared_ptr> >(
+ shared_ptr_helper_id
+ );
+ h.append(sp);
r = sp.get();
}
else{
ar >> boost::serialization::make_nvp("px", r);
}
- ar.reset(t,r);
+ shared_ptr_helper<boost::shared_ptr> & h =
+ ar.template get_helper<shared_ptr_helper<boost::shared_ptr> >(
+ shared_ptr_helper_id
+ );
+ h.reset(t,r);
}
-
#else
+
template<class Archive, class T>
inline void load(
Archive & ar,
@@ -152,7 +163,12 @@ inline void load(
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
T* r;
ar >> boost::serialization::make_nvp("px", r);
- ar.reset(t,r);
+
+ boost::serialization::shared_ptr_helper<boost::shared_ptr> & h =
+ ar.template get_helper<shared_ptr_helper<boost::shared_ptr> >(
+ shared_ptr_helper_id
+ );
+ h.reset(t,r);
}
#endif
@@ -174,4 +190,100 @@ inline void serialize(
} // namespace serialization
} // namespace boost
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// std::shared_ptr serialization traits
+// version 1 to distinguish from boost 1.32 version. Note: we can only do this
+// for a template when the compiler supports partial template specialization
+
+#ifndef BOOST_NO_CXX11_SMART_PTR
+#include <boost/static_assert.hpp>
+
+// note: we presume that any compiler/library which supports C++11
+// std::pointers also supports template partial specialization
+// trap here if such presumption were to turn out to wrong!!!
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ BOOST_STATIC_ASSERT(false);
+#endif
+
+namespace boost {
+namespace serialization{
+ template<class T>
+ struct version< ::std::shared_ptr< T > > {
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_<1> type;
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+ };
+ // don't track shared pointers
+ template<class T>
+ struct tracking_level< ::std::shared_ptr< T > > {
+ typedef mpl::integral_c_tag tag;
+ typedef mpl::int_< ::boost::serialization::track_never> type;
+ BOOST_STATIC_CONSTANT(int, value = type::value);
+ };
+}}
+// the following just keeps older programs from breaking
+#define BOOST_SERIALIZATION_SHARED_PTR(T)
+
+namespace boost {
+namespace serialization{
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization for std::shared_ptr
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const std::shared_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ const T * t_ptr = t.get();
+ ar << boost::serialization::make_nvp("px", t_ptr);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::shared_ptr< T > &t,
+ const unsigned int /*file_version*/
+){
+ // The most common cause of trapping here would be serializing
+ // something like shared_ptr<int>. This occurs because int
+ // is never tracked by default. Wrap int in a trackable type
+ BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
+ T* r;
+ ar >> boost::serialization::make_nvp("px", r);
+ //void (* const id)(Archive &, std::shared_ptr< T > &, const unsigned int) = & load;
+ boost::serialization::shared_ptr_helper<std::shared_ptr> & h =
+ ar.template get_helper<
+ shared_ptr_helper<std::shared_ptr>
+ >(
+ shared_ptr_helper_id
+ );
+ h.reset(t,r);
+}
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::shared_ptr< T > &t,
+ const unsigned int file_version
+){
+ // correct shared_ptr serialization depends upon object tracking
+ // being used.
+ BOOST_STATIC_ASSERT(
+ boost::serialization::tracking_level< T >::value
+ != boost::serialization::track_never
+ );
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_NO_CXX11_SMART_PTR
+
#endif // BOOST_SERIALIZATION_SHARED_PTR_HPP
diff --git a/boost/serialization/shared_ptr_132.hpp b/boost/serialization/shared_ptr_132.hpp
index 9bcefe099b..ea02abdb82 100644
--- a/boost/serialization/shared_ptr_132.hpp
+++ b/boost/serialization/shared_ptr_132.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SHARED_PTR_132_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/shared_ptr_helper.hpp b/boost/serialization/shared_ptr_helper.hpp
new file mode 100644
index 0000000000..f4784ec251
--- /dev/null
+++ b/boost/serialization/shared_ptr_helper.hpp
@@ -0,0 +1,211 @@
+#ifndef BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
+#define BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// shared_ptr_helper.hpp: serialization for boost shared pointern
+
+// (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo
+// 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <map>
+#include <list>
+#include <utility>
+#include <cstddef> // NULL
+
+#include <boost/config.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/type_traits/is_polymorphic.hpp>
+#include <boost/mpl/if.hpp>
+
+#include <boost/serialization/singleton.hpp>
+#include <boost/serialization/extended_type_info.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 headern
+
+namespace boost_132 {
+ template<class T> class shared_ptr;
+}
+namespace boost {
+namespace serialization {
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+template<class Archive, template<class U> class SPT >
+void load(
+ Archive & ar,
+ SPT< class U > &t,
+ const unsigned int file_version
+);
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// a common class for holding various types of shared pointers
+
+template<template<class T> class SPT>
+class shared_ptr_helper {
+ typedef std::map<
+ const void *, // address of object
+ SPT<void> // address shared ptr to single instance
+ > object_shared_pointer_map;
+
+ // list of shared_pointers create accessable by raw pointer. This
+ // is used to "match up" shared pointers loaded at different
+ // points in the archive. Note, we delay construction until
+ // it is actually used since this is by default included as
+ // a "mix-in" even if shared_ptr isn't used.
+ object_shared_pointer_map * m_o_sp;
+
+ struct null_deleter {
+ void operator()(void const *) const {}
+ };
+
+#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || defined(BOOST_MSVC)
+public:
+#else
+ template<class Archive, class U>
+ friend void boost::serialization::load(
+ Archive & ar,
+ SPT< U > &t,
+ const unsigned int file_version
+ );
+#endif
+
+ #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+ // list of loaded pointers. This is used to be sure that the pointers
+ // stay around long enough to be "matched" with other pointers loaded
+ // by the same archive. These are created with a "null_deleter" so that
+ // when this list is destroyed - the underlaying raw pointers are not
+ // destroyed. This has to be done because the pointers are also held by
+ // new system which is disjoint from this set. This is implemented
+ // by a change in load_construct_data below. It makes this file suitable
+ // only for loading pointers into a 1.33 or later boost system.
+ std::list<boost_132::shared_ptr<const void> > * m_pointers_132;
+ BOOST_ARCHIVE_DECL(void)
+ append(const boost_132::shared_ptr<const void> & t){
+ if(NULL == m_pointers_132)
+ m_pointers_132 = new std::list<boost_132::shared_ptr<const void> >;
+ m_pointers_132->push_back(t);
+ }
+ #endif
+
+ struct non_polymorphic {
+ template<class U>
+ static const boost::serialization::extended_type_info *
+ get_object_type(U & ){
+ return & boost::serialization::singleton<
+ typename
+ boost::serialization::type_info_implementation< U >::type
+ >::get_const_instance();
+ }
+ };
+ struct polymorphic {
+ template<class U>
+ static const boost::serialization::extended_type_info *
+ get_object_type(U & u){
+ return boost::serialization::singleton<
+ typename
+ boost::serialization::type_info_implementation< U >::type
+ >::get_const_instance().get_derived_extended_type_info(u);
+ }
+ };
+
+public:
+ template<class T>
+ void reset(SPT< T > & s, T * t){
+ if(NULL == t){
+ 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's eti. This is effectively
+ // the object type identifer
+ typedef typename mpl::if_<
+ is_polymorphic< T >,
+ polymorphic,
+ non_polymorphic
+ >::type type;
+
+ const boost::serialization::extended_type_info * true_type
+ = type::get_object_type(*t);
+
+ // note:if this exception is thrown, be sure that derived pointern
+ // is either registered or exported.
+ if(NULL == true_type)
+ boost::serialization::throw_exception(
+ boost::archive::archive_exception(
+ boost::archive::archive_exception::unregistered_class,
+ this_type->get_debug_info()
+ )
+ );
+ // get void pointer to the most derived type
+ // this uniquely identifies the object referred to
+ // oid = "object identifier"
+ const void * oid = void_downcast(
+ *true_type,
+ *this_type,
+ t
+ );
+ if(NULL == oid)
+ boost::serialization::throw_exception(
+ boost::archive::archive_exception(
+ boost::archive::archive_exception::unregistered_cast,
+ true_type->get_debug_info(),
+ this_type->get_debug_info()
+ )
+ );
+
+ // make tracking array if necessary
+ if(NULL == m_o_sp)
+ m_o_sp = new object_shared_pointer_map;
+
+ typename object_shared_pointer_map::iterator i = m_o_sp->find(oid);
+
+ // if it's a new object
+ if(i == m_o_sp->end()){
+ s.reset(t);
+ std::pair<typename object_shared_pointer_map::iterator, bool> result;
+ result = m_o_sp->insert(std::make_pair(oid, s));
+ BOOST_ASSERT(result.second);
+ }
+ // if the object has already been seen
+ else{
+ s = SPT<T>(i->second, t);
+ }
+ }
+
+ shared_ptr_helper() :
+ m_o_sp(NULL)
+ #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+ , m_pointers_132(NULL)
+ #endif
+ {}
+ virtual ~shared_ptr_helper(){
+ if(NULL != m_o_sp)
+ delete m_o_sp;
+ #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
+ if(NULL != m_pointers_132)
+ delete m_pointers_132;
+ #endif
+ }
+};
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+
+#endif // BOOST_SERIALIZATION_SHARED_PTR_HELPER_HPP
diff --git a/boost/serialization/singleton.hpp b/boost/serialization/singleton.hpp
index f521590e1a..546118c868 100644
--- a/boost/serialization/singleton.hpp
+++ b/boost/serialization/singleton.hpp
@@ -30,7 +30,7 @@
//
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/slist.hpp b/boost/serialization/slist.hpp
index f369fcaf27..4072076fa4 100644
--- a/boost/serialization/slist.hpp
+++ b/boost/serialization/slist.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SLIST_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -70,7 +70,7 @@ inline void load(
boost::serialization::detail::stack_construct<Archive, U> u(ar, item_version);
ar >> boost::serialization::make_nvp("item", u.reference());
t.push_front(u.reference());
- BOOST_DEDUCED_TYPENAME BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>::iterator last;
+ typename BOOST_STD_EXTENSION_NAMESPACE::slist<U, Allocator>::iterator last;
last = t.begin();
while(--count > 0){
boost::serialization::detail::stack_construct<Archive, U>
diff --git a/boost/serialization/smart_cast.hpp b/boost/serialization/smart_cast.hpp
index c240a55edc..02edb4be09 100644
--- a/boost/serialization/smart_cast.hpp
+++ b/boost/serialization/smart_cast.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SMART_CAST_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -56,6 +56,8 @@
#include <boost/mpl/not.hpp>
#include <boost/mpl/identity.hpp>
+#include <boost/serialization/throw_exception.hpp>
+
namespace boost {
namespace serialization {
namespace smart_cast_impl {
@@ -93,15 +95,15 @@ namespace smart_cast_impl {
// cross casting will be selected this will work but will
// not be the most efficient method. This will conflict with
// the original smart_cast motivation.
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME mpl::and_<
+ typedef typename mpl::eval_if<
+ typename mpl::and_<
mpl::not_<is_base_and_derived<
- BOOST_DEDUCED_TYPENAME remove_reference< T >::type,
+ typename remove_reference< T >::type,
U
> >,
mpl::not_<is_base_and_derived<
U,
- BOOST_DEDUCED_TYPENAME remove_reference< T >::type
+ typename remove_reference< T >::type
> >
>,
// borland chokes w/o full qualification here
@@ -129,7 +131,7 @@ namespace smart_cast_impl {
mpl::identity<non_polymorphic>
>::type::cast(u);
#else
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typedef typename mpl::eval_if<
boost::is_polymorphic<U>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
@@ -159,7 +161,7 @@ namespace smart_cast_impl {
static T cast(U * u){
T tmp = dynamic_cast< T >(u);
#ifndef NDEBUG
- if ( tmp == 0 ) throw std::bad_cast();
+ if ( tmp == 0 ) throw_exception(std::bad_cast());
#endif
return tmp;
}
@@ -168,7 +170,7 @@ namespace smart_cast_impl {
template<class U>
static T cast(U * u){
// if we're in debug mode
- #if ! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
+ #if 0 //! defined(NDEBUG) || defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
// do a checked dynamic cast
return cross::cast(u);
#else
@@ -178,15 +180,15 @@ namespace smart_cast_impl {
// not be the most efficient method. This will conflict with
// the original smart_cast motivation.
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME mpl::and_<
+ typename mpl::eval_if<
+ typename mpl::and_<
mpl::not_<is_base_and_derived<
- BOOST_DEDUCED_TYPENAME remove_pointer< T >::type,
+ typename remove_pointer< T >::type,
U
> >,
mpl::not_<is_base_and_derived<
U,
- BOOST_DEDUCED_TYPENAME remove_pointer< T >::type
+ typename remove_pointer< T >::type
> >
>,
// borland chokes w/o full qualification here
@@ -201,7 +203,7 @@ namespace smart_cast_impl {
static T cast(U * u){
T tmp = dynamic_cast< T >(u);
#ifndef NDEBUG
- if ( tmp == 0 ) throw std::bad_cast();
+ if ( tmp == 0 ) throw_exception(std::bad_cast());
#endif
return tmp;
}
@@ -224,7 +226,7 @@ namespace smart_cast_impl {
mpl::identity<non_polymorphic>
>::type::cast(u);
#else
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typedef typename mpl::eval_if<
boost::is_polymorphic<U>,
mpl::identity<polymorphic>,
mpl::identity<non_polymorphic>
@@ -265,8 +267,8 @@ namespace smart_cast_impl {
template<class T, class U>
T smart_cast(U u) {
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME mpl::or_<
+ typename mpl::eval_if<
+ typename mpl::or_<
boost::is_same<void *, U>,
boost::is_same<void *, T>,
boost::is_same<const void *, U>,
@@ -274,10 +276,10 @@ T smart_cast(U u) {
>,
mpl::identity<smart_cast_impl::void_pointer< T > >,
// else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_pointer<U>,
+ typename mpl::eval_if<boost::is_pointer<U>,
mpl::identity<smart_cast_impl::pointer< T > >,
// else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_reference<U>,
+ typename mpl::eval_if<boost::is_reference<U>,
mpl::identity<smart_cast_impl::reference< T > >,
// else
mpl::identity<smart_cast_impl::error< T >
diff --git a/boost/serialization/split_free.hpp b/boost/serialization/split_free.hpp
index 9dbcd2fd1d..85e2f590fe 100644
--- a/boost/serialization/split_free.hpp
+++ b/boost/serialization/split_free.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SPLIT_FREE_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -66,8 +66,8 @@ inline void split_free(
T & t,
const unsigned int file_version
){
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME Archive::is_saving,
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
mpl::identity</* detail:: */ free_saver<Archive, T> >,
mpl::identity</* detail:: */ free_loader<Archive, T> >
>::type typex;
diff --git a/boost/serialization/split_member.hpp b/boost/serialization/split_member.hpp
index 69879450d8..5f32520559 100644
--- a/boost/serialization/split_member.hpp
+++ b/boost/serialization/split_member.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -61,8 +61,8 @@ template<class Archive, class T>
inline void split_member(
Archive & ar, T & t, const unsigned int file_version
){
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
- BOOST_DEDUCED_TYPENAME Archive::is_saving,
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
mpl::identity<detail::member_saver<Archive, T> >,
mpl::identity<detail::member_loader<Archive, T> >
>::type typex;
diff --git a/boost/serialization/stack.hpp b/boost/serialization/stack.hpp
new file mode 100644
index 0000000000..aea3ba8e00
--- /dev/null
+++ b/boost/serialization/stack.hpp
@@ -0,0 +1,74 @@
+#ifndef BOOST_SERIALIZATION_STACK_HPP
+#define BOOST_SERIALIZATION_STACK_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// stack.hpp
+
+// (C) Copyright 2014 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <stack>
+#include <boost/config.hpp>
+
+// function specializations must be defined in the appropriate
+// namespace - boost::serialization
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#define STD _STLP_STD
+#else
+#define STD std
+#endif
+
+namespace boost {
+namespace serialization {
+namespace detail{
+
+template <typename U, typename C>
+struct stack_save : public STD::stack<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) const {
+ save(ar, STD::stack<U, C>::c, file_version);
+ }
+};
+template <typename U, typename C>
+struct stack_load : public STD::stack<U, C> {
+ template<class Archive>
+ void operator()(Archive & ar, const unsigned int file_version) {
+ load(ar, STD::stack<U, C>::c, file_version);
+ }
+};
+
+} // detail
+
+template<class Archive, class T, class C>
+inline void serialize(
+ Archive & ar,
+ std::stack< T, C> & t,
+ const unsigned int file_version
+){
+ typedef typename mpl::eval_if<
+ typename Archive::is_saving,
+ mpl::identity<detail::stack_save<T, C> >,
+ mpl::identity<detail::stack_load<T, C> >
+ >::type typex;
+ static_cast<typex &>(t)(ar, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#include <boost/serialization/collection_traits.hpp>
+
+BOOST_SERIALIZATION_COLLECTION_TRAITS(STD::stack)
+
+#undef STD
+
+#endif // BOOST_SERIALIZATION_DEQUE_HPP
diff --git a/boost/serialization/state_saver.hpp b/boost/serialization/state_saver.hpp
index 69cbe3e211..6e6f985784 100644
--- a/boost/serialization/state_saver.hpp
+++ b/boost/serialization/state_saver.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_STATE_SAVER_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -77,7 +77,7 @@ public:
~state_saver() {
#ifndef BOOST_NO_EXCEPTIONS
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typedef typename mpl::eval_if<
has_nothrow_copy< T >,
mpl::identity<restore>,
mpl::identity<restore_with_exception>
diff --git a/boost/serialization/static_warning.hpp b/boost/serialization/static_warning.hpp
index b41791ad86..d2f23d36d2 100644
--- a/boost/serialization/static_warning.hpp
+++ b/boost/serialization/static_warning.hpp
@@ -5,7 +5,7 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -72,6 +72,7 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/print.hpp>
#include <boost/mpl/eval_if.hpp>
+#include <boost/static_assert.hpp>
namespace boost {
namespace serialization {
@@ -101,8 +102,7 @@ struct BOOST_SERIALIZATION_SS {};
#define BOOST_SERIALIZATION_BSW(B, L) \
typedef boost::serialization::BOOST_SERIALIZATION_SS< \
sizeof( boost::serialization::static_warning_test< B, L > ) \
- > BOOST_JOIN(STATIC_WARNING_LINE, L);
-
+ > BOOST_JOIN(STATIC_WARNING_LINE, L) BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE;
#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__)
#endif // BOOST_SERIALIZATION_STATIC_WARNING_HPP
diff --git a/boost/serialization/string.hpp b/boost/serialization/string.hpp
index 36d15942a8..d63df768a7 100644
--- a/boost/serialization/string.hpp
+++ b/boost/serialization/string.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_STRING_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/strong_typedef.hpp b/boost/serialization/strong_typedef.hpp
index c6308c2824..54a51626a7 100644
--- a/boost/serialization/strong_typedef.hpp
+++ b/boost/serialization/strong_typedef.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_STRONG_TYPEDEF_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/throw_exception.hpp b/boost/serialization/throw_exception.hpp
index ed7d8109f2..b67618adc9 100644
--- a/boost/serialization/throw_exception.hpp
+++ b/boost/serialization/throw_exception.hpp
@@ -3,7 +3,7 @@
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/tracking.hpp b/boost/serialization/tracking.hpp
index fadcbd09cf..d5c79b8409 100644
--- a/boost/serialization/tracking.hpp
+++ b/boost/serialization/tracking.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TRACKING_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -41,24 +41,24 @@ template<class T>
struct tracking_level_impl {
template<class U>
struct traits_class_tracking {
- typedef BOOST_DEDUCED_TYPENAME U::tracking type;
+ typedef typename U::tracking type;
};
typedef mpl::integral_c_tag tag;
// note: at least one compiler complained w/o the full qualification
// on basic traits below
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_base_and_derived<boost::serialization::basic_traits, T>,
traits_class_tracking< T >,
//else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_pointer< T >,
// pointers are not tracked by default
mpl::int_<track_never>,
//else
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
// for primitives
- BOOST_DEDUCED_TYPENAME mpl::equal_to<
+ typename mpl::equal_to<
implementation_level< T >,
mpl::int_<primitive_type>
>,
diff --git a/boost/serialization/tracking_enum.hpp b/boost/serialization/tracking_enum.hpp
index e4e4e21359..278051e1ba 100644
--- a/boost/serialization/tracking_enum.hpp
+++ b/boost/serialization/tracking_enum.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TRACKING_ENUM_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/traits.hpp b/boost/serialization/traits.hpp
index da800098a2..d338b1b123 100644
--- a/boost/serialization/traits.hpp
+++ b/boost/serialization/traits.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TRAITS_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -52,9 +52,9 @@ template<
struct traits : public basic_traits {
BOOST_STATIC_ASSERT(Version == 0 || Level >= object_class_info);
BOOST_STATIC_ASSERT(Tracking == track_never || Level >= object_serializable);
- typedef BOOST_DEDUCED_TYPENAME mpl::int_<Level> level;
- typedef BOOST_DEDUCED_TYPENAME mpl::int_<Tracking> tracking;
- typedef BOOST_DEDUCED_TYPENAME mpl::int_<Version> version;
+ typedef typename mpl::int_<Level> level;
+ typedef typename mpl::int_<Tracking> tracking;
+ typedef typename mpl::int_<Version> version;
typedef ETII type_info_implementation;
typedef Wrapper is_wrapper;
};
diff --git a/boost/serialization/type_info_implementation.hpp b/boost/serialization/type_info_implementation.hpp
index 00eb152d8e..2c033fc875 100644
--- a/boost/serialization/type_info_implementation.hpp
+++ b/boost/serialization/type_info_implementation.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_TYPE_INFO_IMPLEMENTATION_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -35,17 +35,17 @@ template<class T>
struct type_info_implementation {
template<class U>
struct traits_class_typeinfo_implementation {
- typedef BOOST_DEDUCED_TYPENAME U::type_info_implementation::type type;
+ typedef typename U::type_info_implementation::type type;
};
// note: at least one compiler complained w/o the full qualification
// on basic traits below
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_base_and_derived<boost::serialization::basic_traits, T>,
traits_class_typeinfo_implementation< T >,
//else
mpl::identity<
- BOOST_DEDUCED_TYPENAME extended_type_info_impl< T >::type
+ typename extended_type_info_impl< T >::type
>
>::type type;
};
diff --git a/boost/serialization/unique_ptr.hpp b/boost/serialization/unique_ptr.hpp
new file mode 100644
index 0000000000..ac615b9d19
--- /dev/null
+++ b/boost/serialization/unique_ptr.hpp
@@ -0,0 +1,68 @@
+#ifndef BOOST_SERIALIZATION_UNIQUE_PTR_HPP
+#define BOOST_SERIALIZATION_UNIQUE_PTR_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// unique_ptr.hpp:
+
+// (C) Copyright 2002 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+#include <memory>
+#include <boost/serialization/split_free.hpp>
+#include <boost/serialization/nvp.hpp>
+
+namespace boost {
+namespace serialization {
+
+/////////////////////////////////////////////////////////////
+// implement serialization for unique_ptr< T >
+// note: this must be added to the boost namespace in order to
+// be called by the library
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const std::unique_ptr< T > &t,
+ const unsigned int file_version
+){
+ // only the raw pointer has to be saved
+ // the ref count is rebuilt automatically on load
+ const T * const tx = t.get();
+ ar << BOOST_SERIALIZATION_NVP(tx);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::unique_ptr< T > &t,
+ const unsigned int file_version
+){
+ T *tx;
+ ar >> BOOST_SERIALIZATION_NVP(tx);
+ // note that the reset automagically maintains the reference count
+ t.reset(tx);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::unique_ptr< T > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+
+#endif // BOOST_SERIALIZATION_UNIQUE_PTR_HPP
diff --git a/boost/serialization/unordered_collections_load_imp.hpp b/boost/serialization/unordered_collections_load_imp.hpp
new file mode 100644
index 0000000000..bf56741342
--- /dev/null
+++ b/boost/serialization/unordered_collections_load_imp.hpp
@@ -0,0 +1,74 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_LOAD_IMP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_LOAD_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+# pragma warning (disable : 4786) // too long name, harmless warning
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// unordered_collections_load_imp.hpp: serialization for loading stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// helper function templates for serialization of collections
+
+#include <boost/assert.hpp>
+#include <cstddef> // size_t
+#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+ using ::size_t;
+} // namespace std
+#endif
+#include <boost/detail/workaround.hpp>
+
+#include <boost/archive/detail/basic_iarchive.hpp>
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/detail/stack_constructor.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+template<class Archive, class Container, class InputFunction>
+inline void load_unordered_collection(Archive & ar, Container &s)
+{
+ s.clear();
+ collection_size_type count;
+ collection_size_type bucket_count;
+ boost::serialization::item_version_type item_version(0);
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ ar >> BOOST_SERIALIZATION_NVP(count);
+ ar >> BOOST_SERIALIZATION_NVP(bucket_count);
+ if(boost::archive::library_version_type(3) < library_version){
+ ar >> BOOST_SERIALIZATION_NVP(item_version);
+ }
+ s.rehash(bucket_count);
+ InputFunction ifunc;
+ while(count-- > 0){
+ ifunc(ar, s, item_version);
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_LOAD_IMP_HPP
diff --git a/boost/serialization/unordered_collections_save_imp.hpp b/boost/serialization/unordered_collections_save_imp.hpp
new file mode 100644
index 0000000000..56746ebeaa
--- /dev/null
+++ b/boost/serialization/unordered_collections_save_imp.hpp
@@ -0,0 +1,86 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// hash_collections_save_imp.hpp: serialization for stl collections
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// helper function templates for serialization of collections
+
+#include <boost/config.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/serialization.hpp>
+#include <boost/serialization/version.hpp>
+#include <boost/serialization/collection_size_type.hpp>
+#include <boost/serialization/item_version_type.hpp>
+
+namespace boost{
+namespace serialization {
+namespace stl {
+
+//////////////////////////////////////////////////////////////////////
+// implementation of serialization for STL containers
+//
+
+template<class Archive, class Container>
+inline void save_unordered_collection(Archive & ar, const Container &s)
+{
+ collection_size_type count(s.size());
+ const collection_size_type bucket_count(s.bucket_count());
+ const item_version_type item_version(
+ version<typename Container::value_type>::value
+ );
+
+ #if 0
+ /* should only be necessary to create archives of previous versions
+ * which is not currently supported. So for now comment this out
+ */
+ boost::archive::library_version_type library_version(
+ ar.get_library_version()
+ );
+ // retrieve number of elements
+ ar << BOOST_SERIALIZATION_NVP(count);
+ ar << BOOST_SERIALIZATION_NVP(bucket_count);
+ if(boost::archive::library_version_type(3) < library_version){
+ // record number of elements
+ // make sure the target type is registered so we can retrieve
+ // the version when we load
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ }
+ #else
+ ar << BOOST_SERIALIZATION_NVP(count);
+ ar << BOOST_SERIALIZATION_NVP(bucket_count);
+ ar << BOOST_SERIALIZATION_NVP(item_version);
+ #endif
+
+ typename Container::const_iterator it = s.begin();
+ while(count-- > 0){
+ // note borland emits a no-op without the explicit namespace
+ boost::serialization::save_construct_data_adl(
+ ar,
+ &(*it),
+ boost::serialization::version<
+ typename Container::value_type
+ >::value
+ );
+ ar << boost::serialization::make_nvp("item", *it++);
+ }
+}
+
+} // namespace stl
+} // namespace serialization
+} // namespace boost
+
+#endif //BOOST_SERIALIZATION_UNORDERED_COLLECTIONS_SAVE_IMP_HPP
diff --git a/boost/serialization/unordered_map.hpp b/boost/serialization/unordered_map.hpp
new file mode 100644
index 0000000000..f3959104d9
--- /dev/null
+++ b/boost/serialization/unordered_map.hpp
@@ -0,0 +1,231 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_MAP_HPP
+#define BOOST_SERIALIZATION_UNORDERED_MAP_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// serialization/unordered_map.hpp:
+// serialization for stl unordered_map templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+
+#include <unordered_map>
+
+#include <boost/serialization/utility.hpp>
+#include <boost/serialization/unordered_collections_save_imp.hpp>
+#include <boost/serialization/unordered_collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+namespace stl {
+
+// map input
+template<class Archive, class Container>
+struct archive_input_unordered_map
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ std::pair<typename Container::const_iterator, bool> result =
+ s.insert(t.reference());
+ // note: the following presumes that the map::value_type was NOT tracked
+ // in the archive. This is the usual case, but here there is no way
+ // to determine that.
+ if(result.second){
+ ar.reset_object_address(
+ & (result.first->second),
+ & t.reference().second
+ );
+ }
+ }
+};
+
+// multimap input
+template<class Archive, class Container>
+struct archive_input_unordered_multimap
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::const_iterator result
+ = s.insert(t.reference());
+ // note: the following presumes that the map::value_type was NOT tracked
+ // in the archive. This is the usual case, but here there is no way
+ // to determine that.
+ ar.reset_object_address(
+ & result->second,
+ & t.reference()
+ );
+ }
+};
+
+} // stl
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_map<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_map<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_map<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_map<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_unordered_map<
+ Archive,
+ std::unordered_map<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_map<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// unordered_multimap
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_unordered_multimap<
+ Archive,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_multimap<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_UNORDERED_MAP_HPP
diff --git a/boost/serialization/unordered_set.hpp b/boost/serialization/unordered_set.hpp
new file mode 100644
index 0000000000..535194fb72
--- /dev/null
+++ b/boost/serialization/unordered_set.hpp
@@ -0,0 +1,216 @@
+#ifndef BOOST_SERIALIZATION_UNORDERED_SET_HPP
+#define BOOST_SERIALIZATION_UNORDERED_SET_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// unordered_set.hpp: serialization for stl unordered_set templates
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// (C) Copyright 2014 Jim Bell
+// 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/config.hpp>
+
+#include <unordered_set>
+
+#include <boost/serialization/unordered_collections_save_imp.hpp>
+#include <boost/serialization/unordered_collections_load_imp.hpp>
+#include <boost/serialization/split_free.hpp>
+
+namespace boost {
+namespace serialization {
+
+namespace stl {
+
+// unordered_set input
+template<class Archive, class Container>
+struct archive_input_unordered_set
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ std::pair<typename Container::const_iterator, bool> result =
+ s.insert(t.reference());
+ if(result.second)
+ ar.reset_object_address(& (* result.first), & t.reference());
+ }
+};
+
+// unordered_multiset input
+template<class Archive, class Container>
+struct archive_input_unordered_multiset
+{
+ inline void operator()(
+ Archive &ar,
+ Container &s,
+ const unsigned int v
+ ){
+ typedef typename Container::value_type type;
+ detail::stack_construct<Archive, type> t(ar, v);
+ // borland fails silently w/o full namespace
+ ar >> boost::serialization::make_nvp("item", t.reference());
+ typename Container::const_iterator result
+ = s.insert(t.reference());
+ ar.reset_object_address(& (* result), & t.reference());
+ }
+};
+
+} // stl
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_unordered_set<
+ Archive,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_set<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+// unordered_multiset
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void save(
+ Archive & ar,
+ const std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::save_unordered_collection<
+ Archive,
+ std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >(ar, t);
+}
+
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void load(
+ Archive & ar,
+ std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int /*file_version*/
+){
+ boost::serialization::stl::load_unordered_collection<
+ Archive,
+ std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ >,
+ boost::serialization::stl::archive_input_unordered_multiset<
+ Archive,
+ std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ >
+ >
+ >(ar, t);
+}
+
+// split non-intrusive serialization function member into separate
+// non intrusive save/load member functions
+template<
+ class Archive,
+ class Key,
+ class HashFcn,
+ class EqualKey,
+ class Allocator
+>
+inline void serialize(
+ Archive & ar,
+ std::unordered_multiset<
+ Key, HashFcn, EqualKey, Allocator
+ > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_SERIALIZATION_UNORDERED_SET_HPP
diff --git a/boost/serialization/utility.hpp b/boost/serialization/utility.hpp
index 3d69abc7b3..4867a4a12d 100644
--- a/boost/serialization/utility.hpp
+++ b/boost/serialization/utility.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_UTILITY_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -38,7 +38,7 @@ inline void serialize(
// note: we remove any const-ness on the first argument. The reason is that
// for stl maps, the type saved is pair<const key, T). We remove
// the const-ness in order to be able to load it.
- typedef BOOST_DEDUCED_TYPENAME boost::remove_const<F>::type typef;
+ typedef typename boost::remove_const<F>::type typef;
ar & boost::serialization::make_nvp("first", const_cast<typef &>(p.first));
ar & boost::serialization::make_nvp("second", p.second);
}
diff --git a/boost/serialization/valarray.hpp b/boost/serialization/valarray.hpp
index 4bf722f4d3..d24fda5437 100644
--- a/boost/serialization/valarray.hpp
+++ b/boost/serialization/valarray.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_VALARAY_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/variant.hpp b/boost/serialization/variant.hpp
index 9c8ea9d931..70e395e211 100644
--- a/boost/serialization/variant.hpp
+++ b/boost/serialization/variant.hpp
@@ -2,14 +2,10 @@
#define BOOST_SERIALIZATION_VARIANT_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
-#if defined(_MSC_VER) && (_MSC_VER <= 1020)
-# pragma warning (disable : 4786) // too long name, harmless warning
-#endif
-
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// variant.hpp - non-intrusive serialization of variant types
//
@@ -70,7 +66,7 @@ void save(
){
int which = v.which();
ar << BOOST_SERIALIZATION_NVP(which);
- typedef BOOST_DEDUCED_TYPENAME boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types types;
+ typedef typename boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types types;
variant_save_visitor<Archive> visitor(ar);
v.apply_visitor(visitor);
}
@@ -101,14 +97,14 @@ struct variant_impl {
// necessary has to copy the value. This wouldn't be necessary
// with an implementation that de-serialized to the address of the
// aligned storage included in the variant.
- typedef BOOST_DEDUCED_TYPENAME mpl::front<S>::type head_type;
+ typedef typename mpl::front<S>::type head_type;
head_type value;
ar >> BOOST_SERIALIZATION_NVP(value);
v = value;
ar.reset_object_address(& boost::get<head_type>(v), & value);
return;
}
- typedef BOOST_DEDUCED_TYPENAME mpl::pop_front<S>::type type;
+ typedef typename mpl::pop_front<S>::type type;
variant_impl<type>::load(ar, which - 1, v, version);
}
};
@@ -120,7 +116,7 @@ struct variant_impl {
V & v,
const unsigned int version
){
- typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<mpl::empty<S>,
+ typedef typename mpl::eval_if<mpl::empty<S>,
mpl::identity<load_null>,
mpl::identity<load_impl>
>::type typex;
@@ -136,7 +132,7 @@ void load(
const unsigned int version
){
int which;
- typedef BOOST_DEDUCED_TYPENAME boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types types;
+ typedef typename boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types types;
ar >> BOOST_SERIALIZATION_NVP(which);
if(which >= mpl::size<types>::value)
// this might happen if a type was removed from the list of variant types
diff --git a/boost/serialization/vector.hpp b/boost/serialization/vector.hpp
index 7520c09a00..3af1d67695 100644
--- a/boost/serialization/vector.hpp
+++ b/boost/serialization/vector.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_VECTOR_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -121,9 +121,9 @@ inline void save(
const std::vector<U, Allocator> &t,
const unsigned int file_version
){
- typedef BOOST_DEDUCED_TYPENAME
+ typedef typename
boost::serialization::use_array_optimization<Archive>::template apply<
- BOOST_DEDUCED_TYPENAME remove_const<U>::type
+ typename remove_const<U>::type
>::type use_optimized;
save(ar,t,file_version, use_optimized());
}
@@ -141,9 +141,9 @@ inline void load(
return;
}
#endif
- typedef BOOST_DEDUCED_TYPENAME
+ typedef typename
boost::serialization::use_array_optimization<Archive>::template apply<
- BOOST_DEDUCED_TYPENAME remove_const<U>::type
+ typename remove_const<U>::type
>::type use_optimized;
load(ar,t,file_version, use_optimized());
}
@@ -159,8 +159,6 @@ inline void serialize(
boost::serialization::split_free(ar, t, file_version);
}
-#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// vector<bool>
template<class Archive, class Allocator>
@@ -207,8 +205,6 @@ inline void serialize(
boost::serialization::split_free(ar, t, file_version);
}
-#endif // BOOST_WORKAROUND
-
} // serialization
} // namespace boost
diff --git a/boost/serialization/version.hpp b/boost/serialization/version.hpp
index ef3dff2f47..21a74d73da 100644
--- a/boost/serialization/version.hpp
+++ b/boost/serialization/version.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_VERSION_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -37,14 +37,14 @@ struct version
{
template<class U>
struct traits_class_version {
- typedef BOOST_DEDUCED_TYPENAME U::version type;
+ typedef typename U::version type;
};
typedef mpl::integral_c_tag tag;
// note: at least one compiler complained w/o the full qualification
// on basic traits below
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<
+ typename mpl::eval_if<
is_base_and_derived<boost::serialization::basic_traits,T>,
traits_class_version< T >,
mpl::int_<0>
diff --git a/boost/serialization/void_cast.hpp b/boost/serialization/void_cast.hpp
index b5b1e8577f..61b6449ef1 100644
--- a/boost/serialization/void_cast.hpp
+++ b/boost/serialization/void_cast.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_VOID_CAST_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
@@ -181,13 +181,13 @@ void_caster_primitive<Derived, Base>::void_caster_primitive() :
void_caster(
& type_info_implementation<Derived>::type::get_const_instance(),
& type_info_implementation<Base>::type::get_const_instance(),
- // note:I wanted to display from 0 here, but at least one compiler
+ // note:I wanted to displace from 0 here, but at least one compiler
// treated 0 by not shifting it at all.
reinterpret_cast<std::ptrdiff_t>(
static_cast<Derived *>(
- reinterpret_cast<Base *>(1)
+ reinterpret_cast<Base *>(8)
)
- ) - 1
+ ) - 8
)
{
recursive_register();
@@ -248,7 +248,7 @@ struct void_caster_base :
public void_caster
{
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
+ typename mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
mpl::identity<
void_cast_detail::void_caster_virtual_base<Derived, Base>
>
@@ -268,7 +268,7 @@ inline const void_cast_detail::void_caster & void_cast_register(
Base const * /* bnull = NULL */
){
typedef
- BOOST_DEDUCED_TYPENAME mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
+ typename mpl::eval_if<boost::is_virtual_base_of<Base,Derived>,
mpl::identity<
void_cast_detail::void_caster_virtual_base<Derived, Base>
>
diff --git a/boost/serialization/void_cast_fwd.hpp b/boost/serialization/void_cast_fwd.hpp
index c94adb2ec2..def61d52bb 100644
--- a/boost/serialization/void_cast_fwd.hpp
+++ b/boost/serialization/void_cast_fwd.hpp
@@ -2,7 +2,7 @@
#define BOOST_SERIALIZATION_VOID_CAST_FWD_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
diff --git a/boost/serialization/weak_ptr.hpp b/boost/serialization/weak_ptr.hpp
index 3fe8698de3..6952d24cb3 100644
--- a/boost/serialization/weak_ptr.hpp
+++ b/boost/serialization/weak_ptr.hpp
@@ -2,12 +2,12 @@
#define BOOST_SERIALIZATION_WEAK_PTR_HPP
// MS compatible compilers support #pragma once
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
# pragma once
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
-// shared_ptr.hpp: serialization for boost shared pointer
+// weak_ptr.hpp: serialization for boost weak pointer
// (C) Copyright 2004 Robert Ramey and Martin Ecker
// Use, modification and distribution is subject to the Boost Software
@@ -55,4 +55,45 @@ inline void serialize(
} // namespace serialization
} // namespace boost
+#ifndef BOOST_NO_CXX11_SMART_PTR
+#include <memory>
+
+namespace boost {
+namespace serialization{
+
+template<class Archive, class T>
+inline void save(
+ Archive & ar,
+ const std::weak_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ const std::shared_ptr< T > sp = t.lock();
+ ar << boost::serialization::make_nvp("weak_ptr", sp);
+}
+
+template<class Archive, class T>
+inline void load(
+ Archive & ar,
+ std::weak_ptr< T > &t,
+ const unsigned int /* file_version */
+){
+ std::shared_ptr< T > sp;
+ ar >> boost::serialization::make_nvp("weak_ptr", sp);
+ t = sp;
+}
+
+template<class Archive, class T>
+inline void serialize(
+ Archive & ar,
+ std::weak_ptr< T > &t,
+ const unsigned int file_version
+){
+ boost::serialization::split_free(ar, t, file_version);
+}
+
+} // namespace serialization
+} // namespace boost
+
+#endif // BOOST_NO_CXX11_SMART_PTR
+
#endif // BOOST_SERIALIZATION_WEAK_PTR_HPP
diff --git a/boost/serialization/wrapper.hpp b/boost/serialization/wrapper.hpp
index eeb4333cac..6a2a730dde 100644
--- a/boost/serialization/wrapper.hpp
+++ b/boost/serialization/wrapper.hpp
@@ -41,7 +41,7 @@ struct is_wrapper_impl :
template<class T>
struct is_wrapper {
- typedef BOOST_DEDUCED_TYPENAME is_wrapper_impl<const T>::type type;
+ typedef typename is_wrapper_impl<const T>::type type;
};
} // serialization