REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::cp_class Struct Reference

A match-time code-point class for the klass_cp opcode: an ASCII bitmap for code points < 0x80 plus a slice of sorted non-ASCII ranges (indexing the program's flat cp_ranges buffer). It is the already-effective set (any \W/[^…] negation is materialised at compile time). Unlike the byte-NFA klass, the ranges are kept and binary-searched at match time — O(log ranges) per position, independent of the range count. More...

Collaboration diagram for real::detail::cp_class:
[legend]

Public Attributes

char_class ascii
 Members < 0x80.
 
std::uint32_t range_begin {}
 First range in the program's cp_ranges buffer.
 
std::uint32_t range_count {}
 
std::uint64_t fingerprint {}
 

Detailed Description

A match-time code-point class for the klass_cp opcode: an ASCII bitmap for code points < 0x80 plus a slice of sorted non-ASCII ranges (indexing the program's flat cp_ranges buffer). It is the already-effective set (any \W/[^…] negation is materialised at compile time). Unlike the byte-NFA klass, the ranges are kept and binary-searched at match time — O(log ranges) per position, independent of the range count.

Member Data Documentation

◆ fingerprint

std::uint64_t real::detail::cp_class::fingerprint {}

Content identity (FNV-1a of ASCII bitmap + every range), set once at intern. The thread-local sparse cp_hi cache keys by this (not a pointer into a program) so a destroyed program's recycled cp_ranges address cannot poison a later class. Read O(1) per codepoint on the hot path — never re-hashed per probe (that would erase the \p{} hot-path gain).

◆ range_count

std::uint32_t real::detail::cp_class::range_count {}

Number of ranges belonging to this class.


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