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]
fmt/10.1.1
fmt/[~11]

View File

@ -38,5 +38,5 @@ struct fmt::formatter<cruft::backtrace> {
}
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 (
cruft::backtrace const &obj,
fmt::format_context &ctx
) {
) const {
fmt::format_to (ctx.out (), "[ ");
auto const &frames = obj.frames ();

View File

@ -8,15 +8,17 @@
#pragma once
#include "./traits.hpp"
#include "../iterator/infix.hpp"
#include <cruft/util/coord/traits.hpp>
#include <cruft/util/iterator/infix.hpp>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <cstddef>
#include <ostream>
#include <algorithm>
namespace cruft {
template <
typename K,
@ -37,19 +39,23 @@ namespace cruft {
}
template <typename T>
struct fmt::formatter<
T,
std::enable_if_t<cruft::is_coord_v<T>, char>
> {
constexpr format_parse_context::iterator
template <typename T, typename Char>
requires (cruft::is_coord_v<T>)
struct fmt::range_format_kind<T, Char> :
std::integral_constant<fmt::range_format, fmt::range_format::disabled> {};
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)
{
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 (),

View File

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

View File

@ -76,5 +76,5 @@ struct fmt::formatter<cruft::error> {
}
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 (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/args.hpp>
#include <iostream>
#include <fmt/ranges.h>
///////////////////////////////////////////////////////////////////////////////

View File

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

View File

@ -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"