update readme
This commit is contained in:
parent
9d66520257
commit
f5a2489330
1 changed files with 4 additions and 1 deletions
|
@ -102,8 +102,11 @@ int main() {
|
||||||
static_assert("structvar"sv == name);
|
static_assert("structvar"sv == name);
|
||||||
|
|
||||||
name_to_chars(name.c_str()); // 'structvar'
|
name_to_chars(name.c_str()); // 'structvar'
|
||||||
name_to_string(std::string{name}); // 'structvar'
|
// Note: c_str() return name as null-terminated C string, no memory allocation.
|
||||||
|
name_to_string(name.to_string()); // 'structvar'
|
||||||
|
// Note: to_string() occure memory allocation to copy name to std::string.
|
||||||
name_to_string_view(name); // 'structvar'
|
name_to_string_view(name); // 'structvar'
|
||||||
|
// Note: Implicit cast to std::string_view, no memory allocation.
|
||||||
|
|
||||||
#if defined(NAMEOF_ENUM_SUPPORTED)
|
#if defined(NAMEOF_ENUM_SUPPORTED)
|
||||||
// Nameof enum variable.
|
// Nameof enum variable.
|
||||||
|
|
Loading…
Reference in a new issue