30 #ifndef CEREAL_TYPES_BITSET_HPP_
31 #define CEREAL_TYPES_BITSET_HPP_
39 namespace bitset_detail
53 template <
class Archive,
size_t N,
54 traits::EnableIf<traits::is_output_serializable<BinaryData<std::uint32_t>, Archive>::value>
65 for( std::size_t i = 0; i <
N; ++i )
87 template <
class Archive,
size_t N,
88 traits::DisableIf<traits::is_output_serializable<BinaryData<std::uint32_t>, Archive>::value>
94 auto const b = bits.to_ulong();
98 catch( std::overflow_error
const & )
102 auto const b =
bits.to_ullong();
106 catch( std::overflow_error
const & )
115 template <
class Archive,
size_t N>
inline
127 bits = std::bitset<N>( b );
132 unsigned long long b;
134 bits = std::bitset<N>( b );
141 bits = std::bitset<N>( b );
155 for( std::size_t i = 0; i <
N; ++i )
171 throw Exception(
"Invalid bitset data representation");
Main cereal functionality.
#define CEREAL_NVP_(name, value)
Convenience for creating a templated NVP.
Definition: helpers.hpp:201
type
The type the bitset is encoded with.
Definition: bitset.hpp:44
in certain simple scenarios. They should probably not be used if maximizing performance is the main o...
Definition: access.hpp:42
std::enable_if< std::is_arithmetic< T >::value, void >::type CEREAL_LOAD_FUNCTION_NAME(BinaryInputArchive &ar, T &t)
Loading for POD types from binary.
Definition: binary.hpp:126
std::enable_if< std::is_arithmetic< T >::value, void >::type CEREAL_SAVE_FUNCTION_NAME(BinaryOutputArchive &ar, T const &t)
Saving for POD types to binary.
Definition: binary.hpp:118
unsigned char uint8_t
Definition: stdint.h:124
Support for types found in <string>
An exception class thrown when things go wrong at runtime.
Definition: helpers.hpp:49
static const detail::sfinae sfinae
Used as the default value for EnableIf and DisableIf template parameters.
Definition: traits.hpp:88