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

A typed reference into one of the three possessive-loop-body opcodes' own operand spaces. More...

Public Member Functions

constexpr bool armed () const noexcept
 Whether this reference names anything at all.
 

Public Attributes

class_kind kind {class_kind::none}
 Which table REAL refers to; none means unarmed.
 
std::uint16_t index {}
 classes[]/cp_classes[] index (kind == klass/klass_cp), or the literal byte value 0-255 (kind == byte).
 

Friends

constexpr bool operator== (const class_ref &, const class_ref &) noexcept=default
 Equality, comparing kind first so two different tables' indices never collide.
 

Detailed Description

A typed reference into one of the three possessive-loop-body opcodes' own operand spaces.

The untyped alternative – a {classes-index, cp_classes-index, is_cp bool} triple – puts the burden on every comparison site to remember which table an index belongs to. prefilter.hpp's same_atom check did not, and a coincidental collision (both tables' index 0) let [abc].*+ match unconditionally. class_ref's operator== compares kind first, so a byte/klass/klass_cp mismatch cannot compare equal however the indices land.

Member Function Documentation

◆ armed()

constexpr bool real::detail::class_ref::armed ( ) const
inlineconstexprnoexcept

Whether this reference names anything at all.

Returns
False while kind is class_kind::none.

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