Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Namespaces | Typedefs | Functions
bitset.h File Reference
#include <util/check.h>
#include <array>
#include <bit>
#include <cstdint>
#include <limits>
#include <type_traits>
Include dependency graph for bitset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  bitset_detail::IntBitSet< I >
 A bitset implementation backed by a single integer of type I. More...
 
class  bitset_detail::IntBitSet< I >::IteratorEnd
 Dummy type to return using end(). More...
 
class  bitset_detail::IntBitSet< I >::Iterator
 Iterator type returned by begin(), which efficiently iterates all 1 positions. More...
 
class  bitset_detail::MultiIntBitSet< I, N >
 A bitset implementation backed by N integers of type I. More...
 
class  bitset_detail::MultiIntBitSet< I, N >::IteratorEnd
 Dummy type to return using end(). More...
 
class  bitset_detail::MultiIntBitSet< I, N >::Iterator
 Iterator type returned by begin(), which efficiently iterates all 1 positions. More...
 

Namespaces

namespace  bitset_detail
 

Typedefs

template<unsigned BITS>
using BitSet = std::conditional_t<(BITS<=32), bitset_detail::IntBitSet< uint32_t >, std::conditional_t<(BITS<=std::numeric_limits< size_t >::digits), bitset_detail::IntBitSet< size_t >, bitset_detail::MultiIntBitSet< size_t,(BITS+std::numeric_limits< size_t >::digits - 1)/std::numeric_limits< size_t >::digits > > >
 

Functions

template<typename I >
unsigned constexpr bitset_detail::PopCount (I v)
 Count the number of bits set in an unsigned integer type. More...
 

Typedef Documentation

◆ BitSet

template<unsigned BITS>
using BitSet = std::conditional_t<(BITS <= 32), bitset_detail::IntBitSet<uint32_t>, std::conditional_t<(BITS <= std::numeric_limits<size_t>::digits), bitset_detail::IntBitSet<size_t>, bitset_detail::MultiIntBitSet<size_t, (BITS + std::numeric_limits<size_t>::digits - 1) / std::numeric_limits<size_t>::digits> >>

Definition at line 523 of file bitset.h.