#include <magic_enum_containers.hpp>
Classes | |
class | reference_impl |
Public Types | |
using | const_reference = reference_impl< const bitset * > |
using | container_type = std::array< base_type, base_type_count > |
using | index_type = Index |
using | reference = reference_impl<> |
Public Member Functions | |
constexpr bool | all () const noexcept |
constexpr bool | any () const noexcept |
constexpr | bitset (detail::raw_access_t, const char_type *str, std::size_t n=~std::size_t{0}, char_type zero=static_cast< char_type >('0'), char_type one=static_cast< char_type >('1')) |
constexpr | bitset (detail::raw_access_t, string_view sv, string_view::size_type pos=0, string_view::size_type n=string_view::npos, char_type zero=static_cast< char_type >('0'), char_type one=static_cast< char_type >('1')) |
constexpr | bitset (detail::raw_access_t, unsigned long long val) |
constexpr | bitset (detail::raw_access_t=raw_access) noexcept |
constexpr | bitset (std::initializer_list< E > starters) |
template<typename Cmp = std::equal_to<>> | |
constexpr | bitset (string_view sv, Cmp &&cmp={}, char_type sep=static_cast< char_type >('|')) |
template<typename V , std::enable_if_t< std::is_same_v< V, E > &&magic_enum::detail::subtype_v< V >==magic_enum::detail::enum_subtype::flags, int > = 0> | |
constexpr | bitset (V starter) |
constexpr std::size_t | count () const noexcept |
constexpr bitset & | flip () noexcept |
constexpr std::size_t | max_size () const noexcept |
constexpr bool | none () const noexcept |
template<typename V = E> | |
constexpr | operator std::enable_if_t< magic_enum::detail::subtype_v< V >==magic_enum::detail::enum_subtype::flags, E > () const |
constexpr bitset & | operator&= (const bitset &other) noexcept |
constexpr reference | operator[] (E pos) |
constexpr bool | operator[] (E pos) const |
constexpr bitset & | operator^= (const bitset &other) noexcept |
constexpr bitset & | operator|= (const bitset &other) noexcept |
constexpr bitset | operator~ () const noexcept |
constexpr bitset & | reset () noexcept |
constexpr bitset & | reset (E pos) |
constexpr bitset & | set () noexcept |
constexpr bitset & | set (E pos, bool value=true) |
constexpr std::size_t | size () const noexcept |
constexpr bool | test (E pos) const |
string | to_string (char_type sep=static_cast< char_type >('|')) const |
string | to_string (detail::raw_access_t, char_type zero=static_cast< char_type >('0'), char_type one=static_cast< char_type >('1')) const |
constexpr unsigned long long | to_ullong (detail::raw_access_t raw) const |
constexpr unsigned long long | to_ulong (detail::raw_access_t raw) const |
Private Types | |
using | base_type = std::conditional_t< enum_count< E >()<=8, std::uint_least8_t, std::conditional_t< enum_count< E >()<=16, std::uint_least16_t, std::conditional_t< enum_count< E >()<=32, std::uint_least32_t, std::uint_least64_t > >> |
Private Member Functions | |
template<typename T > | |
constexpr T | to_ (detail::raw_access_t) const |
Private Attributes | |
container_type | a |
Static Private Attributes | |
static constexpr std::size_t | base_type_count = (enum_count<E>() > 0 ? (enum_count<E>() - 1) / bits_per_base + 1 : 0) |
static constexpr std::size_t | bits_per_base = sizeof(base_type) * 8 |
static constexpr base_type | last_value_max = (base_type{1} << (bits_per_base - not_interested)) - 1 |
static constexpr std::size_t | not_interested = base_type_count * bits_per_base - enum_count<E>() |
Friends | |
constexpr friend bool | operator!= (const bitset &lhs, const bitset &rhs) noexcept |
constexpr friend bitset | operator& (const bitset &lhs, const bitset &rhs) noexcept |
std::ostream & | operator<< (std::ostream &o, const bitset &bs) |
constexpr friend bool | operator== (const bitset &lhs, const bitset &rhs) noexcept |
std::istream & | operator>> (std::istream &i, bitset &bs) |
constexpr friend bitset | operator^ (const bitset &lhs, const bitset &rhs) noexcept |
constexpr friend bitset | operator| (const bitset &lhs, const bitset &rhs) noexcept |
Definition at line 485 of file magic_enum_containers.hpp.
|
private |
Definition at line 493 of file magic_enum_containers.hpp.
using magic_enum::containers::bitset< E, Index >::const_reference = reference_impl<const bitset*> |
Definition at line 559 of file magic_enum_containers.hpp.
using magic_enum::containers::bitset< E, Index >::container_type = std::array<base_type, base_type_count> |
Definition at line 557 of file magic_enum_containers.hpp.
using magic_enum::containers::bitset< E, Index >::index_type = Index |
Definition at line 556 of file magic_enum_containers.hpp.
using magic_enum::containers::bitset< E, Index >::reference = reference_impl<> |
Definition at line 558 of file magic_enum_containers.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 561 of file magic_enum_containers.hpp.
|
inlineexplicitconstexpr |
Definition at line 563 of file magic_enum_containers.hpp.
|
inlineexplicitconstexpr |
Definition at line 576 of file magic_enum_containers.hpp.
|
inlineexplicitconstexpr |
Definition at line 592 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 595 of file magic_enum_containers.hpp.
|
inlineexplicitconstexpr |
Definition at line 607 of file magic_enum_containers.hpp.
|
inlineexplicitconstexpr |
Definition at line 621 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 659 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 676 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 687 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 761 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 697 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 685 of file magic_enum_containers.hpp.
|
inlineexplicitconstexpr |
Definition at line 782 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 699 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 647 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 642 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 713 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 706 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 720 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 751 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 753 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 732 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 743 of file magic_enum_containers.hpp.
|
inlineconstexprnoexcept |
Definition at line 695 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 652 of file magic_enum_containers.hpp.
|
inlineconstexprprivate |
Definition at line 541 of file magic_enum_containers.hpp.
|
inline |
Definition at line 792 of file magic_enum_containers.hpp.
|
inline |
Definition at line 807 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 816 of file magic_enum_containers.hpp.
|
inlineconstexpr |
Definition at line 818 of file magic_enum_containers.hpp.
|
friend |
Definition at line 640 of file magic_enum_containers.hpp.
|
friend |
Definition at line 763 of file magic_enum_containers.hpp.
|
friend |
Definition at line 820 of file magic_enum_containers.hpp.
|
friend |
Definition at line 638 of file magic_enum_containers.hpp.
|
friend |
Definition at line 822 of file magic_enum_containers.hpp.
|
friend |
Definition at line 775 of file magic_enum_containers.hpp.
|
friend |
Definition at line 769 of file magic_enum_containers.hpp.
|
private |
Definition at line 831 of file magic_enum_containers.hpp.
|
staticconstexprprivate |
Definition at line 496 of file magic_enum_containers.hpp.
|
staticconstexprprivate |
Definition at line 495 of file magic_enum_containers.hpp.
|
staticconstexprprivate |
Definition at line 498 of file magic_enum_containers.hpp.
|
staticconstexprprivate |
Definition at line 497 of file magic_enum_containers.hpp.