Brian Silverman | 8867871 | 2018-08-04 23:56:48 -0700 | [diff] [blame^] | 1 | #ifndef BOOST_SERIALIZATION_ARRAY_HPP |
| 2 | #define BOOST_SERIALIZATION_ARRAY_HPP |
| 3 | |
| 4 | // (C) Copyright 2005 Matthias Troyer and Dave Abrahams |
| 5 | // Use, modification and distribution is subject to the Boost Software |
| 6 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
| 7 | // http://www.boost.org/LICENSE_1_0.txt) |
| 8 | |
| 9 | // for serialization of <array>. If <array> not supported by the standard |
| 10 | // library - this file becomes empty. This is to avoid breaking backward |
| 11 | // compatibiliy for applications which used this header to support |
| 12 | // serialization of native arrays. Code to serialize native arrays is |
| 13 | // now always include by default. RR |
| 14 | |
| 15 | #include <boost/config.hpp> // msvc 6.0 needs this for warning suppression |
| 16 | |
| 17 | #if defined(BOOST_NO_STDC_NAMESPACE) |
| 18 | |
| 19 | #include <iostream> |
| 20 | #include <cstddef> // std::size_t |
| 21 | namespace std{ |
| 22 | using ::size_t; |
| 23 | } // namespace std |
| 24 | #endif |
| 25 | |
| 26 | #include <boost/serialization/array_wrapper.hpp> |
| 27 | |
| 28 | #ifndef BOOST_NO_CXX11_HDR_ARRAY |
| 29 | |
| 30 | #include <array> |
| 31 | #include <boost/serialization/nvp.hpp> |
| 32 | |
| 33 | namespace boost { namespace serialization { |
| 34 | |
| 35 | template <class Archive, class T, std::size_t N> |
| 36 | void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */) |
| 37 | { |
| 38 | ar & boost::serialization::make_nvp( |
| 39 | "elems", |
| 40 | *static_cast<T (*)[N]>(static_cast<void *>(a.data())) |
| 41 | ); |
| 42 | |
| 43 | } |
| 44 | } } // end namespace boost::serialization |
| 45 | |
| 46 | #endif // BOOST_NO_CXX11_HDR_ARRAY |
| 47 | |
| 48 | #endif //BOOST_SERIALIZATION_ARRAY_HPP |