|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
A set of byte values (0–255) as a 256-bit bitmap. More...
#include <charclass.hpp>
Public Member Functions | |
| constexpr void | set (std::uint8_t byte) |
Adds byte byte to the set. | |
| constexpr void | set_range (std::uint8_t low, std::uint8_t high) |
Adds the inclusive byte range [low, high] to the set. | |
| constexpr void | merge (const char_class &other) |
Unions other into this set. | |
| constexpr void | invert_ascii () |
| Complements the ASCII half (bytes 0–127) only. | |
| constexpr void | invert () |
| Full 256-bit complement (binary mode: raw bytes, no UTF-8). | |
| constexpr bool | test (std::uint8_t byte) const |
Tests membership of byte byte. | |
| constexpr bool | empty () const |
| Reports whether the set has no members. | |
| constexpr bool | operator== (const char_class &) const =default |
Public Attributes | |
| std::array< std::uint64_t, 4 > | bits {} |
Bitmap; bit byte is byte byte's membership. | |
A set of byte values (0–255) as a 256-bit bitmap.
Membership, insertion and complement are all O(1) or O(256) and constexpr. All bit manipulation uses unsigned operands (MISRA forbids signed bitwise).
Definition at line 29 of file charclass.hpp.
|
inlineconstexpr |
Reports whether the set has no members.
true if the set is empty. Definition at line 117 of file charclass.hpp.
|
inlineconstexpr |
Full 256-bit complement (binary mode: raw bytes, no UTF-8).
Definition at line 95 of file charclass.hpp.
|
inlineconstexpr |
Complements the ASCII half (bytes 0–127) only.
Bytes >= 0x80 are left untouched; the compiler handles non-ASCII codepoints as explicit UTF-8 multi-byte alternatives instead.
Definition at line 86 of file charclass.hpp.
|
inlineconstexpr |
Unions other into this set.
| [in] | other | The set whose members are added to this one. |
Definition at line 73 of file charclass.hpp.
|
constexprdefault |
|
inlineconstexpr |
Adds byte byte to the set.
| [in] | byte | The byte to insert. |
Definition at line 37 of file charclass.hpp.
|
inlineconstexpr |
Adds the inclusive byte range [low, high] to the set.
| [in] | low | First byte of the range. |
| [in] | high | Last byte of the range (inclusive). |
Definition at line 48 of file charclass.hpp.
|
inlineconstexpr |
Tests membership of byte byte.
| [in] | byte | The byte to test. |
true if byte is in the set. Definition at line 107 of file charclass.hpp.
| std::array<std::uint64_t, 4> real::detail::char_class::bits {} |
Bitmap; bit byte is byte byte's membership.
Definition at line 31 of file charclass.hpp.