|
commons 0.1.5
Header-only C++23 library of common/shared types for the C++ libraries
|
Compile-time fixed-size string usable as a non-type template parameter. More...
#include <fixed_string.hpp>
Public Member Functions | |
| constexpr | FixedString () noexcept=default |
Default-constructs an all-‘’\0'string. | |
| constexpr | FixedString (const char(&str)[N]) noexcept |
Implicit by design: enables Event<"foo"> literal syntax. | |
Public Attributes | |
| char | value [N] {} |
| Character storage, including the trailing null terminator. | |
Compile-time fixed-size string usable as a non-type template parameter.
Construct via CTAD from a string literal:
FixedString id{"order.created"}; // N = 14 (includes null terminator)
The class is a structural type so it can appear directly in template argument lists, e.g. Event<"order.created">.
|
constexprdefaultnoexcept |
Default-constructs an all-‘’\0'string.
Present so the type stays default-constructible — required by nlohmann/json'sfrom_jsonpath (seecommons/json.hpp`).