26 template <
class Archive>
inline
29 size_type portable =
static_cast<size_type
>(size);
30 ar(binary_data(&portable,
sizeof(size_type)));
33 template <
class Archive>
inline
37 ar(binary_data(&portable,
sizeof(size_type)));
38 size =
static_cast<std::size_t
>(portable);
44 template <
class Archive,
class T>
inline
45 typename std::enable_if<traits::is_output_serializable<BinaryData<T>, Archive>::value && std::is_arithmetic<T>::value,
void>::type
48 ar(make_size_tag(
static_cast<size_type
>(data.size())));
49 ar(binary_data(data.data(), data.size() *
sizeof(T)));
52 template <
class Archive,
class T>
inline
53 typename std::enable_if<traits::is_input_serializable<BinaryData<T>, Archive>::value && std::is_arithmetic<T>::value,
void>::type
57 ar(make_size_tag(size));
59 data.reset(
static_cast<std::size_t
>(size));
60 ar(binary_data(data.data(),
static_cast<std::size_t
>(size) *
sizeof(T)));
66 template <
class Archive,
class T,
class A>
inline
67 typename std::enable_if<!traits::is_output_serializable<BinaryData<T>, Archive>::value || !std::is_arithmetic<T>::value,
void>::type
70 ar(make_size_tag(
static_cast<size_type
>(data.size())));
71 for(
auto&& v: data) ar(v);
74 template <
class Archive,
class T,
class A>
inline
75 typename std::enable_if<!traits::is_input_serializable<BinaryData<T>, Archive>::value || !std::is_arithmetic<T>::value,
void>::type
79 ar(make_size_tag(size));
81 data.reset(
static_cast<std::size_t
>(size));
82 for(
auto&& v: data) ar(v);