|
| constexpr | static_vec () noexcept |
| | Value-initializes data_ during constant evaluation only.
|
| |
| constexpr void | push_back (const T &value) |
| | Appends value.
|
| |
|
constexpr void | clear () |
| | Removes all elements (capacity unchanged).
|
| |
| constexpr void | assign (std::size_t count, const T &value) |
| | Resizes to count copies of value.
|
| |
| constexpr void | ensure_size (std::size_t count) |
| | Ensures at least count live elements without re-filling or shrinking.
|
| |
| constexpr std::size_t | size () const |
| | Returns the number of elements.
|
| |
| constexpr bool | empty () const |
| | Returns true if empty.
|
| |
| constexpr T & | operator[] (std::size_t i) |
| | Returns reference to the element at i.
|
| |
| constexpr const T & | operator[] (std::size_t i) const |
| | Returns const reference to the element at i.
|
| |
| constexpr T & | back () |
| | Returns reference to the last element. Precondition: the vector is non-empty.
|
| |
|
constexpr void | pop_back () |
| | Removes the last element. Precondition: the vector is non-empty.
|
| |
template<typename T, std::size_t Cap>
class real::detail::static_vec< T, Cap >
Fixed-capacity vector backed by an inline array (no heap): the subset of std::vector the Pike VM uses, for the static storage mode.
static_storage bounds every engine container from its measure pass, so the length_error guards are an unreachable safety net (hence absent from run-time coverage).
- Template Parameters
-
| T | Element type. |
| Cap | Inline capacity. |
template<typename T , std::size_t Cap>
Ensures at least count live elements without re-filling or shrinking.
Reused capture storage already holds the slot count after the first match and the writer overwrites every used index, so a full assign of npos would be dead work. New elements are NOT written: the caller writes every slot it later reads. Never shrinks: a multi-group path may already be sized to slot_count before a span write.
- Parameters
-
- Exceptions
-
| std::length_error | if count exceeds the capacity Cap. |
template<typename T , std::size_t Cap>
Inline element storage, deliberately NOT value-initialized at run time.
A stateless static_regex builds a fresh state per search(), and clearing the worst-case capacity each call would be most of a short-subject search. Nothing reads above size_; in a constant expression a read before a write is diagnosed.