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

Support fmt and std::format in C++20 module (#394)

This commit is contained in:
CrackedMatter 2025-11-21 16:21:54 +01:00 committed by GitHub
parent 341521b9c0
commit 2e6e8bfff3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,13 @@
module;
#include <version>
#if __has_include(<fmt/format.h>)
#include <fmt/format.h>
#endif
#ifndef MAGIC_ENUM_USE_STD_MODULE
#if defined(__cpp_lib_format)
#include <format>
#endif
#include <magic_enum/magic_enum_all.hpp>
#endif
@ -85,3 +91,9 @@ export namespace std {
using std::formatter;
}
#endif
#if defined(FMT_VERSION)
export namespace fmt {
using fmt::formatter;
}
#endif