stephenberry / glaze

Extremely fast, in memory, JSON and interface library for modern C++
MIT License
1.23k stars 123 forks source link

Problem with enum classes in BVE (JSON -> BVE) #740

Closed cian-dev10 closed 9 months ago

cian-dev10 commented 9 months ago

Hi,

this sample code works with read/write json

            enum class sub : uint8_t
            {
                START,
                END,
                UPDATE_ITEM,
                UPDATE_PRICE,
                                ....
                        }; 

                        struct A {
                            sub b;
                            struct glaze {
                    using T = A;
                    static constexpr auto value = glz::object(
                        "b", &T::b
                    );
                };
                        };

After changing to BVE this behaviour dont work. I could switch to an uint8_t for a easily workaround. Can you have look for that?

Result: 'Glaze metadata is probably needed for your type'

Best regards

stephenberry commented 9 months ago

Thanks for pointing out this bug. Will try to fix this sooner than later.

stephenberry commented 9 months ago

Enums with binary BEVE should now be supported since the merge of #772