build: bump fmtlib to 11

This commit is contained in:
Danny Robson 2024-10-16 11:19:35 +10:00
parent a44260b8b4
commit 4d6a826165
10 changed files with 29 additions and 21 deletions

View File

@ -1,2 +1,2 @@
[requires] [requires]
fmt/10.1.1 fmt/[~11]

View File

@ -38,5 +38,5 @@ struct fmt::formatter<cruft::backtrace> {
} }
format_context::iterator format_context::iterator
format (cruft::backtrace const&, format_context &ctx); format (cruft::backtrace const&, format_context &ctx) const;
}; };

View File

@ -56,7 +56,7 @@ fmt::format_context::iterator
fmt::formatter<cruft::backtrace>::format ( fmt::formatter<cruft::backtrace>::format (
cruft::backtrace const &obj, cruft::backtrace const &obj,
fmt::format_context &ctx fmt::format_context &ctx
) { ) const {
fmt::format_to (ctx.out (), "[ "); fmt::format_to (ctx.out (), "[ ");
auto const &frames = obj.frames (); auto const &frames = obj.frames ();

View File

@ -8,15 +8,17 @@
#pragma once #pragma once
#include "./traits.hpp" #include <cruft/util/coord/traits.hpp>
#include "../iterator/infix.hpp" #include <cruft/util/iterator/infix.hpp>
#include <fmt/format.h> #include <fmt/format.h>
#include <fmt/ranges.h>
#include <cstddef> #include <cstddef>
#include <ostream> #include <ostream>
#include <algorithm> #include <algorithm>
namespace cruft { namespace cruft {
template < template <
typename K, typename K,
@ -37,19 +39,23 @@ namespace cruft {
} }
template <typename T> template <typename T, typename Char>
struct fmt::formatter< requires (cruft::is_coord_v<T>)
T, struct fmt::range_format_kind<T, Char> :
std::enable_if_t<cruft::is_coord_v<T>, char> std::integral_constant<fmt::range_format, fmt::range_format::disabled> {};
> {
constexpr format_parse_context::iterator
template <typename T, typename Char>
requires (cruft::is_coord_v<std::remove_cvref_t<T>>)
struct fmt::formatter<T, Char> {
constexpr auto
parse (format_parse_context &ctx) parse (format_parse_context &ctx)
{ {
return ctx.begin (); return ctx.begin ();
} }
format_context::iterator auto
format (T const &val, format_context &ctx) format (T const &val, format_context &ctx) const
{ {
return fmt::format_to ( return fmt::format_to (
ctx.out (), ctx.out (),

View File

@ -25,7 +25,7 @@ fmt::format_context::iterator
fmt::formatter<cruft::error>::format ( fmt::formatter<cruft::error>::format (
cruft::error const &obj, cruft::error const &obj,
fmt::format_context &ctx fmt::format_context &ctx
) { ) const {
std::ostringstream os; std::ostringstream os;
obj.describe (os); obj.describe (os);
return fmt::format_to (ctx.out (), "{}", os.str ()); return fmt::format_to (ctx.out (), "{}", os.str ());

View File

@ -76,5 +76,5 @@ struct fmt::formatter<cruft::error> {
} }
format_context::iterator format_context::iterator
format (cruft::error const&, format_context &ctx); format (cruft::error const&, format_context &ctx) const;
}; };

View File

@ -51,5 +51,5 @@ struct fmt::formatter<cruft::stats::accumulator<T>> {
} }
format_context::iterator format_context::iterator
format (cruft::stats::accumulator<T> const&, format_context &ctx); format (cruft::stats::accumulator<T> const&, format_context &ctx) const;
}; };

View File

@ -2,7 +2,7 @@
#include <cruft/util/cmdopt2/parser.hpp> #include <cruft/util/cmdopt2/parser.hpp>
#include <cruft/util/cmdopt2/args.hpp> #include <cruft/util/cmdopt2/args.hpp>
#include <iostream> #include <fmt/ranges.h>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -6,6 +6,8 @@
#include <map> #include <map>
#include <fmt/ranges.h>
int main () int main ()
{ {

View File

@ -103,7 +103,7 @@ struct fmt::formatter<::vendor_t> {
} }
format_context::iterator format_context::iterator
format (::vendor_t const &val, format_context &ctx) format (::vendor_t const &val, format_context &ctx) const
{ {
char buf[5] = {}; char buf[5] = {};
@ -228,7 +228,7 @@ struct fmt::formatter<::cache_t> {
} }
format_context::iterator format_context::iterator
format (::cache_t const &val, format_context &ctx) format (::cache_t const &val, format_context &ctx) const
{ {
return fmt::format_to ( return fmt::format_to (
ctx.out (), ctx.out (),
@ -252,7 +252,7 @@ struct fmt::formatter<::splitcache_t> {
} }
format_context::iterator 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); 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_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 (), return fmt::format_to (ctx.out (),
"num_sharing_cache: {}\n" "num_sharing_cache: {}\n"