#include <userver/utils/string_literal.hpp>
Non-empty string view to a compile time known null terminated char array that lives for the lifetime of program, as per [lex.string]; a drop-in replacement for static const std::string kVar = "value"
and constexpr std::string_view kVar = "value"
.
Definition at line 27 of file string_literal.hpp.
Public Member Functions | |
USERVER_IMPL_CONSTEVAL | StringLiteral (const char *literal) noexcept |
constexpr const char * | c_str () const noexcept |
Static Public Member Functions | |
static constexpr StringLiteral | UnsafeMake (const char *str, std::size_t len) noexcept |
|
inlinenoexcept |
Definition at line 37 of file string_literal.hpp.
Definition at line 33 of file null_terminated_view.hpp.
|
inlinestaticconstexprnoexcept |
Constructs a StringLiteral from a pointer and size.
str[len]
should be '\0' and str
should point to compile time literal. Definition at line 44 of file string_literal.hpp.