File tree Expand file tree Collapse file tree 7 files changed +15
-8
lines changed
Expand file tree Collapse file tree 7 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ class bitset_set {
412412 }
413413
414414 std::string fmt_print () const
415- requires has_formatter <KeyT> {
415+ requires fmt::formattable <KeyT> {
416416 std::string s = " {" ;
417417 int c = (int )size ();
418418 for (auto k : *this ) {
Original file line number Diff line number Diff line change 22// vim: ts=8 sw=2 smarttab
33#pragma once
44
5+ #include < fmt/base.h>
56#include < optional>
7+ #include < type_traits>
68
79/* *
810 * \file default fmtlib formatters for specifically-tagged types
1719 * such classes in Crimson.
1820 */
1921
20- template <typename T>
21- concept has_formatter = fmt::has_formatter<T, fmt::format_context>::value;
22+ #if FMT_VERSION < 110000
23+ // TODO: drop me once fmt v11 is required
24+ namespace fmt {
25+ template <typename T, typename Char = char >
26+ concept formattable = is_formattable<std::remove_reference_t <T>, Char>::value>;
27+ }
28+ #endif
2229
2330/* *
2431 * Tagging classes that provide support for default fmtlib formatting,
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ class interval_map {
324324 }
325325
326326 std::string fmt_print () const
327- requires has_formatter <K> {
327+ requires fmt::formattable <K> {
328328 std::string str = " {" ;
329329 bool first = true ;
330330 for (auto &&i: *this ) {
Original file line number Diff line number Diff line change @@ -495,7 +495,7 @@ class mini_flat_map {
495495 }
496496
497497 std::string fmt_print () const
498- requires has_formatter <KeyT> && has_formatter <ValueT> {
498+ requires fmt::formattable <KeyT> && fmt::formattable <ValueT> {
499499 int c = (int )_size;
500500 std::string s = " {" ;
501501 for (auto && [k, v] : *this ) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ struct simple_event_t : sc::event<T> {
4949 }
5050};
5151
52- template <typename T, has_formatter V>
52+ template <typename T, fmt::formattable V>
5353struct value_event_t : sc::event<T> {
5454 const V value;
5555
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ class interval_set {
263263 }
264264
265265 std::string fmt_print () const
266- requires has_formatter <T> {
266+ requires fmt::formattable <T> {
267267 std::string s = " [" ;
268268 bool first = true ;
269269 for (const auto & [start, len] : *this ) {
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ OP_EV(ReplicaReserveReq);
105105// / explicit release request from the Primary
106106OP_EV (ReplicaRelease);
107107
108- template <typename T, has_formatter V>
108+ template <typename T, fmt::formattable V>
109109struct value_event_t : sc::event<T> {
110110 const V value;
111111
You can’t perform that action at this time.
0 commit comments