mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-30 06:09:48 +01:00
Fix path formatter
This commit is contained in:
@@ -8,22 +8,23 @@
|
||||
#ifndef FMT_STD_H_
|
||||
#define FMT_STD_H_
|
||||
|
||||
#include <version>
|
||||
#include "format.h"
|
||||
|
||||
#if FMT_HAS_INCLUDE(<version>)
|
||||
# include <version>
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_lib_filesystem
|
||||
# include <filesystem>
|
||||
|
||||
namespace fmt {
|
||||
|
||||
template <> struct formatter<std::filesystem::path> : formatter<string_view> {
|
||||
template <>
|
||||
struct fmt::formatter<std::filesystem::path> : formatter<string_view> {
|
||||
template <typename FormatContext>
|
||||
auto format(const path& p, FormatContext& ctx) const ->
|
||||
auto format(const std::filesystem::path& p, FormatContext& ctx) const ->
|
||||
typename FormatContext::iterator {
|
||||
return formatter<string_view>::format(p.string(), ctx);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace fmt
|
||||
#endif
|
||||
|
||||
#endif // FMT_STD_H_
|
||||
|
||||
Reference in New Issue
Block a user