diff --git a/include/fmt/std.h b/include/fmt/std.h index 53f21e6f..5e7d3668 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -8,22 +8,23 @@ #ifndef FMT_STD_H_ #define FMT_STD_H_ -#include +#include "format.h" + +#if FMT_HAS_INCLUDE() +# include +#endif #ifdef __cpp_lib_filesystem # include -namespace fmt { - -template <> struct formatter : formatter { +template <> +struct fmt::formatter : formatter { template - auto format(const path& p, FormatContext& ctx) const -> + auto format(const std::filesystem::path& p, FormatContext& ctx) const -> typename FormatContext::iterator { return formatter::format(p.string(), ctx); } }; - -} // namespace fmt #endif #endif // FMT_STD_H_ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1066c5d7..6cdb7ac4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -77,6 +77,7 @@ endif() add_fmt_test(printf-test) add_fmt_test(ranges-test ranges-odr-test.cc) add_fmt_test(scan-test) +add_fmt_test(std-test) add_fmt_test(unicode-test HEADER_ONLY) if (MSVC) target_compile_options(unicode-test PRIVATE /utf-8)