From 2e6e8bfff361c2c40990426c462b44af6c27820b Mon Sep 17 00:00:00 2001 From: CrackedMatter <81803926+CrackedMatter@users.noreply.github.com> Date: Fri, 21 Nov 2025 16:21:54 +0100 Subject: [PATCH] Support fmt and std::format in C++20 module (#394) --- module/magic_enum.cppm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/module/magic_enum.cppm b/module/magic_enum.cppm index ccf99d4..fd6db90 100644 --- a/module/magic_enum.cppm +++ b/module/magic_enum.cppm @@ -1,7 +1,13 @@ module; #include +#if __has_include() +#include +#endif #ifndef MAGIC_ENUM_USE_STD_MODULE +#if defined(__cpp_lib_format) +#include +#endif #include #endif @@ -85,3 +91,9 @@ export namespace std { using std::formatter; } #endif + +#if defined(FMT_VERSION) +export namespace fmt { + using fmt::formatter; +} +#endif