vecs
Fast, flexible ecs in C++ with ergonomic API
Loading...
Searching...
No Matches
vecs::storage::dynamic_bitset Class Reference

A dynamic bitset that automatically grows to support an arbitrary number of bits. More...

#include <dynamic_bitset.h>

Public Types

using size_type = std::uint64_t
 
using block_type = std::uint64_t
 

Public Member Functions

 dynamic_bitset (size_type value)
 
size_type size () const
 
void clear ()
 
void resize (size_type nbits)
 
dynamic_bitsetmasked_and_not (dynamic_bitset &exclude_mask)
 
dynamic_bitsetoperator&= (const dynamic_bitset &rhs)
 
dynamic_bitsetoperator|= (const dynamic_bitset &rhs)
 
dynamic_bitsetoperator^= (const dynamic_bitset &rhs)
 
dynamic_bitset operator~ () const
 
dynamic_bitsetoperator<<= (size_type shift)
 
dynamic_bitsetoperator>>= (size_type shift)
 
bool operator[] (size_type pos) const
 
void set (size_type pos, bool value=true)
 
void reset (size_type pos)
 
void flip (size_type pos)
 
bool operator== (const dynamic_bitset &rhs) const
 
bool operator!= (const dynamic_bitset &rhs) const
 
size_type count () const
 
bool any () const
 
bool none () const
 
bool contains (const dynamic_bitset &other) const
 
bool test (size_type pos) const
 
std::string to_string () const
 

Static Public Attributes

static constexpr size_type bits_per_block
 

Friends

struct std::hash< dynamic_bitset >
 
dynamic_bitset operator& (dynamic_bitset lhs, const dynamic_bitset &rhs)
 
dynamic_bitset operator| (dynamic_bitset lhs, const dynamic_bitset &rhs)
 
dynamic_bitset operator^ (dynamic_bitset lhs, const dynamic_bitset &rhs)
 
dynamic_bitset operator<< (dynamic_bitset lhs, size_type shift)
 
dynamic_bitset operator>> (dynamic_bitset lhs, size_type shift)
 

Detailed Description

A dynamic bitset that automatically grows to support an arbitrary number of bits.

Member Data Documentation

◆ bits_per_block

size_type vecs::storage::dynamic_bitset::bits_per_block
staticconstexpr
Initial value:
=
std::numeric_limits<block_type>::digits

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