You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -584,3 +584,5 @@ reflect-cpp is released under the MIT License. Refer to the LICENSE file for det
584
584
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.
585
585
586
586
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.
Copy file name to clipboardExpand all lines: docs/enums.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Enums
2
2
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.
4
4
5
5
## Normal enumerations
6
6
@@ -27,21 +27,24 @@ This results in the following JSON string:
27
27
28
28
However, some limitations apply:
29
29
30
-
1. They must be scoped enumerations.
30
+
1. They cannot be unnamed enumerations.
31
31
32
32
```cpp
33
-
/// OK - scoped enumeration
33
+
// OK - scoped enumeration
34
34
enumclassColor1 { red, green, blue, yellow };
35
35
36
-
/// OK - scoped enumeration
36
+
// OK - scoped enumeration
37
37
enum struct Color2 { red, green, blue, yellow };
38
38
39
-
/// unsupported - unscoped enumerations
39
+
// OK - unscoped enumeration
40
40
enum Color3 { red, green, blue, yellow };
41
+
42
+
/// Unsupported: Anonymous enumeration
43
+
enum { red, green, blue, yellow };
41
44
```
42
45
43
46
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]`.
45
48
46
49
- You can specify a custom range for the all enum values by defining `RFL_ENUM_RANGE_MIN` and `RFL_ENUM_RANGE_MAX`
0 commit comments