←back to thread

196 points svlasov | 2 comments | | HN request time: 0s | source
Show context
TillE ◴[] No.40851335[source]
Finally. I think there have been proposals since C++17 at least, and all I really wanted is for them to solve the common problem of basic static reflection for enums (without hacks like magic_enum uses).
replies(1): >>40851454 #
jjmarr ◴[] No.40851454[source]
magic_enum is killing my build time with endless template instantiations. Is this going to be faster?
replies(3): >>40851746 #>>40853037 #>>40871158 #
dakka1 ◴[] No.40871158[source]
If you're using C++20 or above, you could try conjure_enum (https://github.com/fix8mt/conjure_enum) It's based on magic_enum but optimized for C++20. Not sure about compile times although in our testing and with our test users it hasn't been reported as an issue.

Yes, there is magic_enum already - and we based this implementation on the core of magic_enum, but refocused for C++20, using some of the key features of this language version such constexpr algorithms, std::source_location and concepts; we also improved on and expanded the API.

replies(1): >>40908829 #
1. jjmarr ◴[] No.40908829[source]
I'm trying it, and this library doesn't work on clang 14. Do you have any insight as to why?
replies(1): >>40910641 #
2. dakka1 ◴[] No.40910641[source]
Not supported. Minimum 15. See "8. Compiler support"