diff --git a/ostd/format.hh b/ostd/format.hh index 04e75f6..c2001c1 100644 --- a/ostd/format.hh +++ b/ostd/format.hh @@ -173,17 +173,6 @@ namespace detail { } } - /* fallback test for whether a value can be converted to string */ - template - static std::true_type test_fmt_tostr( - decltype(ostd::to_string{}(std::declval())) * - ); - template - static std::false_type test_fmt_tostr(...); - - template - constexpr bool fmt_tostr_test = decltype(test_fmt_tostr(0))::value; - /* ugly ass check for whether a type is tuple-like, like tuple itself, * pair, array, possibly other types added later or overridden... */ @@ -734,14 +723,6 @@ private: write_float(writer, val); return; } - /* stuff that can be to_string'd, worst reliable case, allocates */ - if constexpr(detail::fmt_tostr_test) { - if (spec() != 's') { - throw format_error{"custom objects need the '%s' spec"}; - } - write_val(writer, false, ostd::to_string{}(val)); - return; - } /* we ran out of options, failure */ throw format_error{"the value cannot be formatted"}; }