|
12 | 12 | #ifndef MRDOCS_API_SUPPORT_ERROR_HPP |
13 | 13 | #define MRDOCS_API_SUPPORT_ERROR_HPP |
14 | 14 |
|
15 | | -#include <mrdocs/Platform.hpp> |
16 | | -#include <mrdocs/Support/source_location.hpp> |
17 | | -#include <fmt/format.h> |
18 | 15 | #include <exception> |
| 16 | +#include <format> |
| 17 | +#include <functional> |
19 | 18 | #include <memory> |
| 19 | +#include <mrdocs/Platform.hpp> |
| 20 | +#include <mrdocs/Support/source_location.hpp> |
20 | 21 | #include <string> |
21 | 22 | #include <string_view> |
| 23 | +#include <system_error> |
22 | 24 | #include <type_traits> |
23 | 25 | #include <utility> |
24 | 26 | #include <vector> |
25 | | -#include <functional> |
26 | 27 |
|
27 | 28 | namespace clang::mrdocs { |
28 | 29 |
|
@@ -256,28 +257,20 @@ struct std::hash<::clang::mrdocs::Error> |
256 | 257 | } |
257 | 258 | }; |
258 | 259 |
|
259 | | -template<> |
260 | | -struct fmt::formatter<clang::mrdocs::Error> |
261 | | - : fmt::formatter<std::string_view> |
262 | | -{ |
263 | | - auto format( |
264 | | - clang::mrdocs::Error const& err, |
265 | | - fmt::format_context& ctx) const |
266 | | - { |
267 | | - return fmt::formatter<std::string_view>::format(err.message(), ctx); |
268 | | - } |
| 260 | +template <> |
| 261 | +struct std::formatter<clang::mrdocs::Error> : std::formatter<std::string_view> { |
| 262 | + template <class FmtContext> |
| 263 | + auto format(clang::mrdocs::Error const &err, FmtContext &ctx) const { |
| 264 | + return std::formatter<std::string_view>::format(err.message(), ctx); |
| 265 | + } |
269 | 266 | }; |
270 | 267 |
|
271 | | -template<> |
272 | | -struct fmt::formatter<std::error_code> |
273 | | - : fmt::formatter<std::string_view> |
274 | | -{ |
275 | | - auto format( |
276 | | - std::error_code const& ec, |
277 | | - fmt::format_context& ctx) const |
278 | | - { |
279 | | - return fmt::formatter<std::string_view>::format(ec.message(), ctx); |
280 | | - } |
| 268 | +template <> |
| 269 | +struct std::formatter<std::error_code> : std::formatter<std::string_view> { |
| 270 | + template <class FmtContext> |
| 271 | + auto format(std::error_code const &ec, FmtContext &ctx) const { |
| 272 | + return std::formatter<std::string_view>::format(ec.message(), ctx); |
| 273 | + } |
281 | 274 | }; |
282 | 275 |
|
283 | 276 | namespace clang::mrdocs { |
@@ -353,9 +346,8 @@ formatError( |
353 | 346 | Args&&... args) |
354 | 347 | { |
355 | 348 | std::string s; |
356 | | - fmt::vformat_to( |
357 | | - std::back_inserter(s), |
358 | | - fs.fs, fmt::make_format_args(args...)); |
| 349 | + std::vformat_to(std::back_inserter(s), fs.fs, |
| 350 | + std::make_format_args(args...)); |
359 | 351 | return Error(std::move(s), fs.loc); |
360 | 352 | } |
361 | 353 |
|
|
0 commit comments