1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

Fix redefinition errors in module (regression fix)

Fixes type redefinition errors when compiling magic_enum as a module with the MAGIC_ENUM_USE_STD_MODULE preprocessor variable defined.
This commit is contained in:
ChristopherCanfield 2025-12-10 15:18:50 -05:00
parent 2e6e8bfff3
commit ffb57fe2ca

View file

@ -59,7 +59,9 @@ std::string format_as(E e) {
#if defined(__cpp_lib_format)
#ifndef MAGIC_ENUM_USE_STD_MODULE
#include <format>
#endif
template <typename E>
struct std::formatter<E, std::enable_if_t<std::is_enum_v<std::decay_t<E>>, char>> : std::formatter<std::string_view, char> {