From 4d6a82616536b9904f702c18b2360baae7f6b6cd Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 16 Oct 2024 11:19:35 +1000 Subject: [PATCH] build: bump fmtlib to 11 --- conanfile.txt | 2 +- cruft/util/backtrace.hpp | 2 +- cruft/util/backtrace_execinfo.cpp | 2 +- cruft/util/coord/iostream.hpp | 26 ++++++++++++++++---------- cruft/util/except.cpp | 2 +- cruft/util/except.hpp | 2 +- cruft/util/stats.hpp | 2 +- test/cmdopt2.cpp | 2 +- test/geom/sample/edge.cpp | 2 ++ tools/cpuid.cpp | 8 ++++---- 10 files changed, 29 insertions(+), 21 deletions(-) diff --git a/conanfile.txt b/conanfile.txt index 8877d6e5..e6e667a3 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,2 +1,2 @@ [requires] -fmt/10.1.1 +fmt/[~11] diff --git a/cruft/util/backtrace.hpp b/cruft/util/backtrace.hpp index 12126533..b7dae0bb 100644 --- a/cruft/util/backtrace.hpp +++ b/cruft/util/backtrace.hpp @@ -38,5 +38,5 @@ struct fmt::formatter { } format_context::iterator - format (cruft::backtrace const&, format_context &ctx); + format (cruft::backtrace const&, format_context &ctx) const; }; diff --git a/cruft/util/backtrace_execinfo.cpp b/cruft/util/backtrace_execinfo.cpp index 70411626..49ae205a 100644 --- a/cruft/util/backtrace_execinfo.cpp +++ b/cruft/util/backtrace_execinfo.cpp @@ -56,7 +56,7 @@ fmt::format_context::iterator fmt::formatter::format ( cruft::backtrace const &obj, fmt::format_context &ctx -) { +) const { fmt::format_to (ctx.out (), "[ "); auto const &frames = obj.frames (); diff --git a/cruft/util/coord/iostream.hpp b/cruft/util/coord/iostream.hpp index 21e698c4..a65879ad 100644 --- a/cruft/util/coord/iostream.hpp +++ b/cruft/util/coord/iostream.hpp @@ -8,15 +8,17 @@ #pragma once -#include "./traits.hpp" -#include "../iterator/infix.hpp" +#include +#include #include +#include #include #include #include + namespace cruft { template < typename K, @@ -37,19 +39,23 @@ namespace cruft { } -template -struct fmt::formatter< - T, - std::enable_if_t, char> -> { - constexpr format_parse_context::iterator +template +requires (cruft::is_coord_v) +struct fmt::range_format_kind : + std::integral_constant {}; + + +template +requires (cruft::is_coord_v>) +struct fmt::formatter { + constexpr auto parse (format_parse_context &ctx) { return ctx.begin (); } - format_context::iterator - format (T const &val, format_context &ctx) + auto + format (T const &val, format_context &ctx) const { return fmt::format_to ( ctx.out (), diff --git a/cruft/util/except.cpp b/cruft/util/except.cpp index ae7fd728..a876d78e 100644 --- a/cruft/util/except.cpp +++ b/cruft/util/except.cpp @@ -25,7 +25,7 @@ fmt::format_context::iterator fmt::formatter::format ( cruft::error const &obj, fmt::format_context &ctx -) { +) const { std::ostringstream os; obj.describe (os); return fmt::format_to (ctx.out (), "{}", os.str ()); diff --git a/cruft/util/except.hpp b/cruft/util/except.hpp index ff95a5b8..f485ac16 100644 --- a/cruft/util/except.hpp +++ b/cruft/util/except.hpp @@ -76,5 +76,5 @@ struct fmt::formatter { } format_context::iterator - format (cruft::error const&, format_context &ctx); + format (cruft::error const&, format_context &ctx) const; }; \ No newline at end of file diff --git a/cruft/util/stats.hpp b/cruft/util/stats.hpp index 8e07fd7e..01121b87 100644 --- a/cruft/util/stats.hpp +++ b/cruft/util/stats.hpp @@ -51,5 +51,5 @@ struct fmt::formatter> { } format_context::iterator - format (cruft::stats::accumulator const&, format_context &ctx); + format (cruft::stats::accumulator const&, format_context &ctx) const; }; \ No newline at end of file diff --git a/test/cmdopt2.cpp b/test/cmdopt2.cpp index a3b27d7c..d4d8fb23 100644 --- a/test/cmdopt2.cpp +++ b/test/cmdopt2.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include /////////////////////////////////////////////////////////////////////////////// diff --git a/test/geom/sample/edge.cpp b/test/geom/sample/edge.cpp index d05ef573..487fd644 100644 --- a/test/geom/sample/edge.cpp +++ b/test/geom/sample/edge.cpp @@ -6,6 +6,8 @@ #include +#include + int main () { diff --git a/tools/cpuid.cpp b/tools/cpuid.cpp index 45ad3f83..0872aca0 100644 --- a/tools/cpuid.cpp +++ b/tools/cpuid.cpp @@ -103,7 +103,7 @@ struct fmt::formatter<::vendor_t> { } format_context::iterator - format (::vendor_t const &val, format_context &ctx) + format (::vendor_t const &val, format_context &ctx) const { char buf[5] = {}; @@ -228,7 +228,7 @@ struct fmt::formatter<::cache_t> { } format_context::iterator - format (::cache_t const &val, format_context &ctx) + format (::cache_t const &val, format_context &ctx) const { return fmt::format_to ( ctx.out (), @@ -252,7 +252,7 @@ struct fmt::formatter<::splitcache_t> { } format_context::iterator - format (::splitcache_t const &val, format_context &ctx) + format (::splitcache_t const &val, format_context &ctx) const { return fmt::format_to (ctx.out (), "d:\n{}\ni:\n{}\n", val.d, val.i); } @@ -323,7 +323,7 @@ struct fmt::formatter<::cachetopology_t> { } format_context::iterator - format (::cachetopology_t const &val, format_context &ctx) + format (::cachetopology_t const &val, format_context &ctx) const { return fmt::format_to (ctx.out (), "num_sharing_cache: {}\n"