That Terminal
A terminal emulator designed for video making purposes.
constexpr_bitset< N > Class Template Reference

Public Types

using elem_t = unsigned long
 Internal type of atoms in this array.
 

Public Member Functions

constexpr void set (std::size_t idx)
 
constexpr bool test (std::size_t idx) const
 
constexpr void set_n (std::size_t idx, std::size_t count)
 

Public Attributes

elem_t data [nwords] {}
 Storage of data.
 

Static Public Attributes

static constexpr std::size_t WordSize = sizeof(elem_t) * 8
 Number of bits per elem_t.
 
static constexpr std::size_t nwords = (N + WordSize-1) / WordSize
 Number of elem_t's stored.
 
static constexpr elem_t full = ~elem_t{}
 Bitmask of everything set.
 

Detailed Description

template<std::size_t N>
class constexpr_bitset< N >

A bitset structure that can be initialized at compile-time and read at both compile-time and run-time.

Parameters
Nnumber of bits that this set can store.

Member Function Documentation

◆ set()

template<std::size_t N>
constexpr void constexpr_bitset< N >::set ( std::size_t  idx)
inlineconstexpr

Set bit at given index.

Parameters
idxIndex to set. Counting starts from zero, and must be less than N.

◆ set_n()

template<std::size_t N>
constexpr void constexpr_bitset< N >::set_n ( std::size_t  idx,
std::size_t  count 
)
inlineconstexpr

Set a range of bits.

Parameters
idxFirst bit to set
countCount of bits to set

◆ test()

template<std::size_t N>
constexpr bool constexpr_bitset< N >::test ( std::size_t  idx) const
inlineconstexpr

Test bit at given index.

Parameters
idxIndex to read. Counting starts from zero, and must be less than N.
Returns
Whether the given bit is set.

The documentation for this class was generated from the following file: