welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::detail::fixed_string< N > Struct Template Reference

A string literal captured by value, length included, so it can live in a structural annotation constant. More...

#include <welder/annotations.hpp>

Public Member Functions

consteval fixed_string (const char(&s)[N])
 Capture the characters of s.

Public Attributes

char data [N] {}
 The captured characters, including the terminator.

Detailed Description

template<size_type N>
struct welder::detail::fixed_string< N >

A string literal captured by value, length included, so it can live in a structural annotation constant.

Doc text is stored inline (a char array) rather than as a const char* to a string literal: a pointer-to-literal is not a permitted annotation value (gcc-16 rejects it as a non-structural constant), whereas an inline array is.

Template Parameters
Nthe literal's length including the terminator (deduced).

Definition at line 257 of file annotations.hpp.

Constructor & Destructor Documentation

◆ fixed_string()

template<size_type N>
welder::detail::fixed_string< N >::fixed_string ( const char(&) s[N])
inlineconsteval

Capture the characters of s.

Parameters
sthe source string literal.

Definition at line 260 of file annotations.hpp.

References data.

Member Data Documentation

◆ data

template<size_type N>
char welder::detail::fixed_string< N >::data[N] {}

The captured characters, including the terminator.

Definition at line 258 of file annotations.hpp.

Referenced by fixed_string().


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