#include <refl.hpp>
Public Member Functions | |
constexpr | const_string () noexcept |
constexpr | const_string (const const_string< N > &other) noexcept |
constexpr | const_string (const char(&data)[N+1]) noexcept |
constexpr | operator const char * () const noexcept |
operator std::string () const noexcept | |
constexpr const char * | c_str () const noexcept |
std::string | str () const noexcept |
template<size_t Pos, size_t Count = npos> | |
constexpr auto | substr () const noexcept |
Public Attributes | |
char | data [N+1] |
Static Public Attributes | |
static constexpr size_t | npos = static_cast<size_t>(-1) |
static constexpr size_t | size = N |
Represents a compile-time string. Used in refl-cpp for representing names of reflected types and members. Supports constexpr concatenation and substring, and is explicitly-convertible to const char* and std::string. REFL_MAKE_CONST_STRING can be used to create an instance from a literal string.
@typeparam <N> The length of the string excluding the terminating '\0' character.
|
inlineconstexprnoexcept |
Creates an empty const_string.
|
inlineconstexprnoexcept |
Creates a copy of a const_string.
|
inlineconstexprnoexcept |
Creates a const_string by copying the contents of data.
|
inlineconstexprnoexcept |
Returns a pointer to the contained zero-terminated string.
|
inlineexplicitconstexprnoexcept |
Explicitly converts to const char*.
|
inlineexplicitnoexcept |
Explicitly converts to std::string.
|
inlinenoexcept |
Returns the contained string as an std::string.
|
inlineconstexprnoexcept |
A constexpr version of std::string::substr.
char refl::util::const_string< N >::data[N+1] |
The statically-sized character buffer used for storing the string.
|
staticconstexpr |
The largest positive value size_t can hold.
|
staticconstexpr |
The length of the string excluding the terminating '\0' character.