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
I'm not sure if this is misuse by me or a defect.
Using clang-18 and libc++-18: I cannot get the following to work...
#include <magic_enum.hpp> #include <magic_enum_format.hpp> enum class my_enum {a, b, c}; int main(int,char**) { std::println("Enabled? {}", magic_enum::customize::enum_format_enabled<my_enum>()); const std::string a = std::format("a? {}",my_enum::a); std::println("ab: {} {}", a, my_enum::b); return 0; }
...without force defining _cpp_lib_format...
#if !defined(__cpp_lib_format) # define __cpp_lib_format 1 #endif
...and adding a template line to this code to make it:
struct std::formatter<E, std::enable_if_t<std::is_enum_v<std::decay_t<E>> && magic_enum::customize::enum_format_enabled<E>(), char>> : std::formatter<std::string_view, char> { template<typename format_context> // ADDED auto format(E e, format_context& ctx) const {
Any insight would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
Quite strange, if compiler support <format> then __cpp_lib_format if defined, see https://en.cppreference.com/w/cpp/utility/feature_test
<format>
__cpp_lib_format
Sorry, something went wrong.
Looks like fixed in #365
No branches or pull requests
I'm not sure if this is misuse by me or a defect.
Using clang-18 and libc++-18:
I cannot get the following to work...
...without force defining _cpp_lib_format...
...and adding a template line to this code to make it:
Any insight would be appreciated. Thank you!
The text was updated successfully, but these errors were encountered: