-
Notifications
You must be signed in to change notification settings - Fork 3
/
boost_serialize_array.h
40 lines (31 loc) · 1.01 KB
/
boost_serialize_array.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. See the enclosed file LICENSE for a copy or if
* that was not distributed with this file, You can obtain one at
* http://mozilla.org/MPL/2.0/.
*
* Copyright 2017 Max H. Gerlach
*
* */
/*
* boost_serialize_array.h
*
* Created on: Apr 17, 2013
* Author: max
*/
#ifndef BOOST_SERIALIZE_ARRAY_H_
#define BOOST_SERIALIZE_ARRAY_H_
//serialization support for std::array or checkarray
#include <array>
#include "checkarray.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wshadow"
#include "boost/serialization/array.hpp"
#pragma GCC diagnostic pop
namespace boost { namespace serialization {
template <class Archive, class T, std::size_t N>
void serialize(Archive& ar, checkarray<T,N>& a, const uint32_t /* version */) {
ar & boost::serialization::make_array(a.data(), a.size());
}
} } //namespace boost::serialization
#endif /* BOOST_SERIALIZE_ARRAY_H_ */