11 #ifndef __FAST_BITSET_HEADER
12 #define __FAST_BITSET_HEADER
17 #include "../util/byte_operation.hpp"
22 template<
bool,
bool,
bool,
bool>
23 struct size_trait_impl {
26 struct size_trait_impl<false, false, false, false> {
30 struct size_trait_impl<true, false, false, false> {
31 typedef uint16_t type;
34 struct size_trait_impl<true, true, false, false> {
35 typedef uint32_t type;
38 struct size_trait_impl<true, true, true, false> {
39 typedef uint64_t type;
44 typedef typename detail::size_trait_impl<(N > 8), (N > 16), (N > 32), (N > 64)>
::type type;
62 void set() { data_ =
T(-1); }
89 template<
typename Archive>
101 #endif //__FAST_BITSET_HEADER
uint8_t size_type
Definition: fast_bitset.hpp:51
void flip(size_type const &pos)
Definition: fast_bitset.hpp:65
void reset()
Definition: fast_bitset.hpp:66
bool none() const
Definition: fast_bitset.hpp:79
void set()
Definition: fast_bitset.hpp:62
void reset(size_type const &pos)
Definition: fast_bitset.hpp:67
void clear_bit(T &unit, uint8_t const &pos)
Definition: byte_operation.hpp:44
void serialize(Archive &ar)
Definition: fast_bitset.hpp:90
fast_bitset()
Definition: fast_bitset.hpp:53
fast_bitset & operator=(fast_bitset const &rhs)
Definition: fast_bitset.hpp:57
void print(S &os) const
Definition: fast_bitset.hpp:84
void write_bit(T &unit, uint8_t const &pos, bool state=true)
Definition: byte_operation.hpp:48
Definition: fast_bitset.hpp:48
void set(size_type const &pos, uint8_t const &val=true)
Definition: fast_bitset.hpp:63
void flip_bit(T &unit, uint8_t const &pos)
Definition: byte_operation.hpp:52
bool operator[](size_type const &pos) const
Definition: fast_bitset.hpp:69
void flip()
Definition: fast_bitset.hpp:64
detail::size_trait_impl<(N > 8),(N > 16),(N > 32),(N > 64)>::type type
Definition: fast_bitset.hpp:44
size_trait< N >::type T
Definition: fast_bitset.hpp:50
bool any() const
Definition: fast_bitset.hpp:76
fast_bitset(fast_bitset const &arg)
Definition: fast_bitset.hpp:55
bool read_bit(T const &unit, uint8_t const &pos)
Definition: byte_operation.hpp:36
#define ASSERT(exp)
Definition: ard_assert.hpp:33
Definition: fast_bitset.hpp:43