REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::pike_vm< State, StateBoundToProgram >::slot_pair Struct Reference

A two-slot sink, for a filler that must call a route function expecting a slot container. More...

#include <pike.hpp>

Public Member Functions

constexpr void assign (std::size_t n, std::size_t value) noexcept
 Sets both slots to value.
 
constexpr void resize (std::size_t n) noexcept
 No-op: the pair is already at its final size.
 
constexpr std::size_t size () const noexcept
 The slot count.
 
constexpr std::size_t & operator[] (std::size_t i) noexcept
 Slot access.
 
constexpr const std::size_t & operator[] (std::size_t i) const noexcept
 Slot access, const.
 

Public Attributes

std::size_t slots [2] {npos, npos}
 [0] is the match start, [1] the match end.
 

Detailed Description

template<typename State, bool StateBoundToProgram = false>
struct real::detail::pike_vm< State, StateBoundToProgram >::slot_pair

A two-slot sink, for a filler that must call a route function expecting a slot container.

The batched routes all arm on slot_count == 2, so the whole-match span is every slot the program has. This exists so fill_inner_literal_spans can reuse run_inner_literal verbatim – one mechanism rather than a copy of its confirm logic – without pulling real::detail::small_vec into this header, which storage.hpp cannot do (it includes this one), and without putting a 256-byte inline buffer on refill_batch's frame.

It satisfies exactly what the route touches: assign, resize, size and indexing.

Member Function Documentation

◆ assign()

template<typename State , bool StateBoundToProgram = false>
constexpr void real::detail::pike_vm< State, StateBoundToProgram >::slot_pair::assign ( std::size_t  n,
std::size_t  value 
)
inlineconstexprnoexcept

Sets both slots to value.

Parameters
[in]nThe route's slot_count; must be 2, and is ignored.
[in]valueThe value written to both slots (the route passes real::npos).

◆ operator[]() [1/2]

template<typename State , bool StateBoundToProgram = false>
constexpr const std::size_t & real::detail::pike_vm< State, StateBoundToProgram >::slot_pair::operator[] ( std::size_t  i) const
inlineconstexprnoexcept

Slot access, const.

Parameters
[in]iSlot index, 0 or 1.
Returns
A const reference to that slot.

◆ operator[]() [2/2]

template<typename State , bool StateBoundToProgram = false>
constexpr std::size_t & real::detail::pike_vm< State, StateBoundToProgram >::slot_pair::operator[] ( std::size_t  i)
inlineconstexprnoexcept

Slot access.

Parameters
[in]iSlot index, 0 or 1.
Returns
A reference to that slot.

◆ resize()

template<typename State , bool StateBoundToProgram = false>
constexpr void real::detail::pike_vm< State, StateBoundToProgram >::slot_pair::resize ( std::size_t  n)
inlineconstexprnoexcept

No-op: the pair is already at its final size.

Parameters
[in]nThe requested size; must be 2, and is ignored.

◆ size()

template<typename State , bool StateBoundToProgram = false>
constexpr std::size_t real::detail::pike_vm< State, StateBoundToProgram >::slot_pair::size ( ) const
inlineconstexprnoexcept

The slot count.

Returns
Always 2.

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