22 #include <boost/static_assert.hpp>
37 template<
unsigned long long Val>
71 template<
class T, T... args>
77 template<
class T,
T...
args>
146 template<
unsigned long long Val,
template<
unsigned long long>
class Fn,
class T, T... ct_bits>
153 template<
template<
unsigned long long>
class Fn,
class T,
T...
ct_bits>
158 template<u_int8_t Chars>
161 struct bits_to_type<1> {
165 struct bits_to_type<2> {
169 struct bits_to_type<3> {
173 struct bits_to_type<4> {
177 struct bits_to_type<5> {
181 struct bits_to_type<6> {
185 struct bits_to_type<7> {
189 struct bits_to_type<8> {
193 template<u_int8_t NumBits>
233 BOOST_STATIC_ASSERT((
sizeof(
element_type)*8)<=
std::numeric_limits<
typename cache_t::range_type>::max());
243 count+=cache_t::type::value[num%cache_t::max_size];
244 }
while (num/=cache_t::max_size);
249 return cache_t::efficiency();
259 template<
unsigned long long Val,
template<
unsigned long long>
class Fn,
unsigned long long... bitmasks>
263 template<
template<
unsigned long long>
class Fn,
unsigned long long...
bitmasks>
268 template<
unsigned long long Val>
270 constexpr static unsigned long long value=(Val>>1);
274 constexpr static unsigned long long value=0ULL;
277 template<u_int8_t Val,
class BitSet>
284 return ((num & BitSet::value[Val]) ? 1 : 0 ) +
base_t::result(num);
287 template<
class BitSet>
309 typedef private_::gen_bitmasks<1ULL<<((
sizeof(element_type)*8)-1), private_::shifter>::type bitmasks;
310 typedef private_::unroller<bitmasks::value.size()-1, bitmasks> unroller_t;
317 return unroller_t::result(num);