Skip to content

Commit 4db94de

Browse files
Updated the documentation
1 parent 267f890 commit 4db94de

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,3 +584,5 @@ reflect-cpp is released under the MIT License. Refer to the LICENSE file for det
584584
reflect-cpp includes [YYJSON](https://github.com/ibireme/yyjson), the fastest JSON library currently in existence. YYJSON is written by YaoYuan and also released under the MIT License.
585585

586586
reflect-cpp includes [compile-time-regular-expressions](https://github.com/hanickadot/compile-time-regular-expressions). CTRE is written by Hana Dusíková and released under the Apache-2.0 License with LLVM exceptions.
587+
588+
reflect-cpp includes [enchantum](https://github.com/ZXShady/enchantum/tree/main). enchantum is written by ZXShady and also released under the MIT License.

docs/enums.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enums
22

3-
reflect-cpp supports scoped enumerations. They can either come in the form of normal enumerations or flag enums.
3+
reflect-cpp supports both scoped and unscoped enumerations as long as they are named. They can either come in the form of normal enumerations or flag enums.
44

55
## Normal enumerations
66

@@ -27,21 +27,24 @@ This results in the following JSON string:
2727

2828
However, some limitations apply:
2929

30-
1. They must be scoped enumerations.
30+
1. They cannot be unnamed enumerations.
3131

3232
```cpp
33-
/// OK - scoped enumeration
33+
// OK - scoped enumeration
3434
enum class Color1 { red, green, blue, yellow };
3535

36-
/// OK - scoped enumeration
36+
// OK - scoped enumeration
3737
enum struct Color2 { red, green, blue, yellow };
3838

39-
/// unsupported - unscoped enumerations
39+
// OK - unscoped enumeration
4040
enum Color3 { red, green, blue, yellow };
41+
42+
/// Unsupported: Anonymous enumeration
43+
enum { red, green, blue, yellow };
4144
```
4245

4346
2. Enum values must be in the range `[RFL_ENUM_RANGE_MIN, RFL_ENUM_RANGE_MAX]`. If the range is not specified, the
44-
default range is `[0, 127]`.
47+
default range is `[-256, 256]`.
4548

4649
- You can specify a custom range for the all enum values by defining `RFL_ENUM_RANGE_MIN` and `RFL_ENUM_RANGE_MAX`
4750
before including the reflect-cpp header:

0 commit comments

Comments
 (0)