|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Fixed-capacity vector backed by an inline array (no heap). More...
#include <storage.hpp>
Public Member Functions | |
| 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 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. | |
Private Attributes | |
| std::array< T, Cap > | data_ {} |
| Inline element storage. | |
| std::size_t | size_ {} |
| Number of elements in use. | |
Fixed-capacity vector backed by an inline array (no heap).
The subset of std::vector the Pike VM uses, for the static storage mode. Overflow cannot happen for the engine's own containers: static_storage sizes each one exactly via its measure pass, so the length_error guards are an unreachable structural safety net — kept deliberately, and never hit at run time (hence not covered by the runtime coverage report).
| T | Element type. |
| Cap | Inline capacity. |
Definition at line 90 of file storage.hpp.
|
inlineconstexpr |
Resizes to count copies of value.
| [in] | count | Number of elements. |
| [in] | value | The value to fill with. |
| std::length_error | if count exceeds the capacity Cap. |
Definition at line 122 of file storage.hpp.
|
inlineconstexpr |
Returns reference to the last element. Precondition: the vector is non-empty.
Definition at line 173 of file storage.hpp.
|
inlineconstexpr |
Removes all elements (capacity unchanged).
Definition at line 111 of file storage.hpp.
|
inlineconstexpr |
Returns true if empty.
Definition at line 145 of file storage.hpp.
|
inlineconstexpr |
Returns reference to the element at i.
| [in] | i | Index. |
i. Definition at line 155 of file storage.hpp.
|
inlineconstexpr |
Returns const reference to the element at i.
| [in] | i | Index. |
i. Definition at line 165 of file storage.hpp.
|
inlineconstexpr |
Removes the last element. Precondition: the vector is non-empty.
Definition at line 182 of file storage.hpp.
|
inlineconstexpr |
Appends value.
| [in] | value | The element to append. |
| std::length_error | if the capacity Cap is exceeded. |
Definition at line 99 of file storage.hpp.
|
inlineconstexpr |
Returns the number of elements.
Definition at line 137 of file storage.hpp.
|
private |
Inline element storage.
Definition at line 190 of file storage.hpp.
|
private |
Number of elements in use.
Definition at line 191 of file storage.hpp.