summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/serialization/array.hpp')
-rw-r--r--3rdParty/Boost/src/boost/serialization/array.hpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/3rdParty/Boost/src/boost/serialization/array.hpp b/3rdParty/Boost/src/boost/serialization/array.hpp
index 3391a96..35c640c 100644
--- a/3rdParty/Boost/src/boost/serialization/array.hpp
+++ b/3rdParty/Boost/src/boost/serialization/array.hpp
@@ -3,16 +3,20 @@
// (C) Copyright 2005 Matthias Troyer and Dave Abrahams
// 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)
+#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;
} // namespace std
#endif
@@ -94,15 +98,15 @@ public:
}
// default implementation
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());
}
value_type* address() const
{
@@ -125,29 +129,43 @@ inline
const
#endif
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__
// ignore optimizations for Borland
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive)
#else
#define BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(Archive) \
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__
#endif //BOOST_SERIALIZATION_ARRAY_HPP