We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#include <iostream> #include "glaze/glaze.hpp" enum class MyEnum { X = 1 << 0, Y = 1 << 1, Z = 1 << 2 }; MyEnum operator|(MyEnum a, MyEnum b) { return static_cast<MyEnum>(static_cast<int>(a) | static_cast<int>(b)); } template<> struct glz::meta<MyEnum> { using enum MyEnum; static constexpr auto value = enumerate(X, Y, Z); }; struct my_struct { MyEnum flags{ MyEnum::X | MyEnum::Z }; }; int main() { my_struct obj{}; std::cout << glz::write_json(obj).value_or("error") << '\n'; return 0; }
This displays as {"flags":5} instead of the expected string value (eg. {"flags": "X | Z"})
{"flags":5}
{"flags": "X | Z"}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This displays as
{"flags":5}
instead of the expected string value (eg.{"flags": "X | Z"}
)The text was updated successfully, but these errors were encountered: