32 #ifndef CEREAL_TYPES_VALARRAY_HPP_
33 #define CEREAL_TYPES_VALARRAY_HPP_
41 template <
class Archive,
class T>
inline
42 typename std::enable_if<traits::is_output_serializable<BinaryData<T>, Archive>::value
43 && std::is_arithmetic<T>::value,
void>::type
46 ar( make_size_tag(
static_cast<size_type>(valarray.size()) ) );
47 ar( binary_data( &valarray[0], valarray.size() *
sizeof(T) ) );
51 template <
class Archive,
class T>
inline
52 typename std::enable_if<traits::is_input_serializable<BinaryData<T>, Archive>::value
53 && std::is_arithmetic<T>::value,
void>::type
57 ar( make_size_tag( valarraySize ) );
59 valarray.resize(
static_cast<std::size_t
>( valarraySize ) );
60 ar( binary_data( &valarray[0],
static_cast<std::size_t
>( valarraySize ) *
sizeof(T) ) );
64 template <
class Archive,
class T>
inline
65 typename std::enable_if<!traits::is_output_serializable<BinaryData<T>, Archive>::value
66 || !std::is_arithmetic<T>::value,
void>::type
69 ar( make_size_tag(
static_cast<size_type>(valarray.size()) ) );
70 for(
auto && v : valarray)
75 template <
class Archive,
class T>
inline
76 typename std::enable_if<!traits::is_input_serializable<BinaryData<T>, Archive>::value
77 || !std::is_arithmetic<T>::value,
void>::type
81 ar( make_size_tag( valarraySize ) );
83 valarray.resize(
static_cast<size_t>( valarraySize ) );
84 for(
auto && v : valarray)
89 #endif // CEREAL_TYPES_VALARRAY_HPP_