30 #ifndef CEREAL_TYPES_VECTOR_HPP_
31 #define CEREAL_TYPES_VECTOR_HPP_
39 template <
class Archive,
class T,
class A>
inline
40 typename std::enable_if<traits::is_output_serializable<BinaryData<T>, Archive>::value
41 && std::is_arithmetic<T>::value && !std::is_same<T, bool>::value,
void>::type
44 ar( make_size_tag(
static_cast<size_type>(vector.size()) ) );
45 ar( binary_data( vector.data(), vector.size() *
sizeof(T) ) );
49 template <
class Archive,
class T,
class A>
inline
50 typename std::enable_if<traits::is_input_serializable<BinaryData<T>, Archive>::value
51 && std::is_arithmetic<T>::value && !std::is_same<T, bool>::value,
void>::type
55 ar( make_size_tag( vectorSize ) );
57 vector.resize(
static_cast<std::size_t
>( vectorSize ) );
58 ar( binary_data( vector.data(),
static_cast<std::size_t
>( vectorSize ) *
sizeof(T) ) );
62 template <
class Archive,
class T,
class A>
inline
63 typename std::enable_if<(!traits::is_output_serializable<BinaryData<T>, Archive>::value
64 || !std::is_arithmetic<T>::value) && !std::is_same<T, bool>::value,
void>::type
67 ar( make_size_tag(
static_cast<size_type>(vector.size()) ) );
68 for(
auto && v : vector)
73 template <
class Archive,
class T,
class A>
inline
74 typename std::enable_if<(!traits::is_input_serializable<BinaryData<T>, Archive>::value
75 || !std::is_arithmetic<T>::value) && !std::is_same<T, bool>::value,
void>::type
79 ar( make_size_tag( size ) );
81 vector.resize(
static_cast<std::size_t
>( size ) );
82 for(
auto && v : vector)
87 template <
class Archive,
class A>
inline
90 ar( make_size_tag(
static_cast<size_type>(vector.size()) ) );
91 for(
const auto v : vector)
92 ar(
static_cast<bool>(v) );
96 template <
class Archive,
class A>
inline
100 ar( make_size_tag( size ) );
102 vector.resize(
static_cast<std::size_t
>( size ) );
103 for(
auto && v : vector)
112 #endif // CEREAL_TYPES_VECTOR_HPP_