From fd6a47c2231590a774013608bfcf9424564b6e4f Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 12 Feb 2017 23:02:49 +0100 Subject: [PATCH] re-add zero-argument format impl and fix char_traits usage for const char ranges --- ostd/format.hh | 10 ++++++++++ ostd/string.hh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ostd/format.hh b/ostd/format.hh index a1c8a3f..02968af 100644 --- a/ostd/format.hh +++ b/ostd/format.hh @@ -912,6 +912,16 @@ namespace detail { written += twr; return written; } + + template + inline ptrdiff_t format_impl(R &writer, bool, ConstCharRange fmt) { + size_t written = 0; + detail::WriteSpec spec(fmt, false); + if (spec.read_until_spec(writer, &written)) { + throw format_error{"format spec without format arguments"}; + } + return written; + } } /* namespace detail */ template diff --git a/ostd/string.hh b/ostd/string.hh index 485b4da..c745650 100644 --- a/ostd/string.hh +++ b/ostd/string.hh @@ -22,7 +22,7 @@ namespace ostd { -template> +template>> struct CharRangeBase: InputRange< CharRangeBase, ContiguousRangeTag, T > {