From 1358223955d9c2b2b6b64f2199b7ebdcae362181 Mon Sep 17 00:00:00 2001 From: stu Date: Fri, 1 Mar 2024 19:23:32 +0000 Subject: [PATCH] add small section to README --- README.md | 3 +++ docs/enums.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 843c5ce9..5bf0c1f6 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,9 @@ This results in the following JSON string: {"pos_x":2.0,"pos_y":3.0,"shape":"square","color":"red|blue"} ``` +You can also directly convert between enumerator values and strings with `rfl::enum_to_string()` and `rfl::string_to_enum()`, or +obtain list of enumerator name and value pairs with `rfl::get_enumerators()` or `rfl::get_enumerator_array()`. + ## Algebraic data types reflect-cpp supports Pydantic-style tagged unions, which allow you to form algebraic data types: diff --git a/docs/enums.md b/docs/enums.md index b13a37cf..8de33da0 100644 --- a/docs/enums.md +++ b/docs/enums.md @@ -148,7 +148,7 @@ This works, because 16 + 256 + 512 + 1024 + 8192 = 10000. Flag enums are *always ## General-purpose enumeration utilities -reflect-cpp also allows you to directly convert between enumeration values and strings: +reflect-cpp also allows you to directly convert between enumerator values and strings: ```cpp enum class Color { red, green, blue };