Closed gerwaric closed 1 year ago
No just use git commit —amend and force push to your branch.
On Tue, 17 Oct 2023 at 16:57, Tom Holz @.***> wrote:
@.**** commented on this pull request.
In include/json_struct/json_struct.h https://github.com/jorgen/json_struct/pull/51#discussion_r1362275806:
@@ -4524,6 +4524,88 @@ void populateEnumNames(std::vector
&names, const char (&data)[N]) }; \ } +#define JS_ENUM_DECLARE_VALUE_PARSER(name) \
- namespace JS \
- { \
- template <> \
- struct TypeHandler
\ - { \
- static inline Error to(name &to_type, ParseContext &context) \
- { \
- if (std::is_unsigned
::value) \ Yes, std::underlying_type even better. Modern c++ keeps surprising me.
Should I submit another pull request and let you cancel this one? (I'm still learning how to use github)
— Reply to this email directly, view it on GitHub https://github.com/jorgen/json_struct/pull/51#discussion_r1362275806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHQVRIX2Q5GVIAXNZO2RTX72MFDAVCNFSM6AAAAAA6DI3V7CVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTMOBSGYYDIMBTGE . You are receiving this because you commented.Message ID: @.***>
Should be done now, thanks.
Thank you for your contribution!
You're welcome, and thank you for maintaining such a useful and easy-to-use json library.
Added two new macros for enums: JS_ENUM_DECLARE_VALUE_PARSER and JS_ENUM_NAMESPACE_DECLARE_VALUE_PARSER. These work like the existing enum parser macros. They define type handlers for an enum, but instead of using the name of the enumeration, the underlying value is read and written as an integer.
This was developed as an alternative to generalizing JS_ENUM to handle enumeration declarations with initializers.