REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::fixed_string< N > Struct Template Reference

A fixed-size string usable as a non-type template parameter. More...

#include <storage.hpp>

Public Member Functions

constexpr fixed_string (const char(&literal)[N])
 Captures a string literal.
 
constexpr std::string_view view () const
 Returns a view of the string, excluding the trailing NUL.
 

Public Attributes

char data [N] = {}
 The captured characters, including the trailing NUL.
 

Detailed Description

template<std::size_t N>
struct real::fixed_string< N >

A fixed-size string usable as a non-type template parameter.

Enables static_regex<"\d+">: the literal is captured into data at compile time.

Template Parameters
NSize of the character array, including the terminating NUL.

Definition at line 46 of file storage.hpp.

Constructor & Destructor Documentation

◆ fixed_string()

template<std::size_t N>
constexpr real::fixed_string< N >::fixed_string ( const char(&)  literal[N])
inlineconstexpr

Captures a string literal.

Implicit by design: it is what lets a string literal be a non-type template argument; marking it explicit would defeat the purpose.

Parameters
[in]literalThe string literal to capture.

Definition at line 59 of file storage.hpp.

Member Function Documentation

◆ view()

template<std::size_t N>
constexpr std::string_view real::fixed_string< N >::view ( ) const
inlineconstexpr

Returns a view of the string, excluding the trailing NUL.

Definition at line 69 of file storage.hpp.

Member Data Documentation

◆ data

template<std::size_t N>
char real::fixed_string< N >::data[N] = {}

The captured characters, including the trailing NUL.

Definition at line 48 of file storage.hpp.


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