Changes pending approval

1
 
1
Nameof C++ - Tagline
Diff:
  • cpp
  • C++
Suggested by Neargye
2
 
0
Nameof C++ - Tag names
Diff:
  • C++17, Cpp17, Nameof, Nameof-operator, Serialization
  • C++17, Cpp17, Enum-to-String, Nameof, Nameof-operator, Serialization
Suggested by Neargye
2
 
0
Nameof C++ - License
From: - - -
To: MIT License
Suggested by Neargye
0
 
2
Nameof C++ - Description
Diff:
  • Before, you had to use string literals to refer to definitions, which is brittle when renaming code elements because tools do not know to check these string literals.
  • Before, you had to use string literals to refer to definitions, which is brittle when renaming code elements because tools do not know to check these string literals.
  • Examples
  • * Name of variable
  • ```cpp
  • // Name of variable
  • NAMEOF(somevar) -> "somevar"
  • // Name of member variable
  • NAMEOF(person.address.zip_code) -> "zip_code"
  • constexpr auto cx_name = NAMEOF(somevar);
  • static_assert("somevar" == cx_name);
  • ```
  • * Name of function
  • ```cpp
  • // Name of function
  • NAMEOF(some_method<int, float>) -> "some_method"
  • NAMEOF_FULL(some_method<int, float>) -> "some_method<int, float>"
  • // Name of member function
  • NAMEOF(somevar.foo()) -> "foo"
  • NAMEOF_FULL(somevar.boo<int>()) -> "boo<int>"
  • constexpr auto cx_name = NAMEOF(somevar.foo());
  • static_assert("foo" == cx_name);
  • ```
  • * Name of enum
  • ```cpp
  • auto c = Color::RED;
  • // Name of enum variable
  • NAMEOF_ENUM(c) -> "RED"
  • // Name of enum variable
  • nameof::nameof_enum(c) -> "RED"
  • constexpr auto cx_name = NAMEOF_ENUM(c);
  • static_assert("RED" == cx_name);
  • constexpr auto cx_color = Color::RED;
  • // Name of static storage enum variable
  • nameof::nameof_enum<cx_color>() -> "RED"
  • ```
  • * Name of type
  • ```cpp
  • // Name of variable type
  • NAMEOF_TYPE(Color::RED) -> "Color"
  • // Name of type
  • NAMEOF_TYPE_T(int) -> "int"
  • // Name of variable type
  • nameof::nameof_type<decltype(Color::RED)>() -> "Color"
  • // Name of type
  • nameof::nameof_type<int>() -> "int"
  • constexpr auto cx_name = NAMEOF_TYPE(Color::RED);
  • static_assert("Color" == cx_name);
  • ```
  • * Name of macro
  • ```cpp
  • // Name of macro
  • NAMEOF(__LINE__) -> "__LINE__"
  • constexpr auto cx_name = NAMEOF(__LINE__);
  • static_assert("__LINE__" == cx_name);
  • ```
Suggested by Neargye
2
 
0
Nameof C++ - Tag names
Diff:
  • C++17, Cpp17, Nameof, Nameof-operator, Serialization
  • Cpp17, Nameof, Nameof-operator, Serialization, С++17
Suggested by Neargye
2
 
0
Nameof C++ - Tagline
Diff:
  • cpp
  • Nameof operator for modern C++
Suggested by Neargye
2
 
0
Magic Enum C++ - Tagline
Diff:
  • Enum-to-String and String-to-Enum functions for modern C++
  • Static reflection for enums for modern C++, work with any enum type without any macro or boilerplate code
Suggested by Neargye
2
 
0
Magic Enum C++ - Description
Diff:
  • Header-only C++17 library provides Enum-to-String and String-to-Enum functions.
  • Header-only C++17 library provides static reflection for enums, work with any enum type without any macro or boilerplate code.
  • enum_cast obtains enum value from string or integer.
  • enum_value returns enum value at specified index.
  • enum_values obtains enum value sequence.
  • enum_count returns number of enum values.
  • enum_name obtains string name from enum value.
  • enum_names obtains string enum name sequence.
  • is_unscoped_enum checks whether type is an Unscoped enumeration.
  • is_scoped_enum checks whether type is an Scoped enumeration.
Suggested by Neargye