From e75ca99d2137d2ae0d19c46bcc4dafb0d2cd5e45 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 9 Dec 2016 14:10:28 +0000 Subject: Split parser buffer from upto buffer (simpler) --- libadhocutil/compileTimeFormatter.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index d45d662..064c4e3 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -117,6 +117,8 @@ namespace AdHoc { static int err; }; + template struct ParserBuffer { }; + template struct Parser { static auto parse() @@ -128,19 +130,19 @@ namespace AdHoc { return Parser::innerparse(); } template - static auto append(const Buffer & b) + static auto append(const ParserBuffer & b) { return join(b, Parser::parse()); } template - static auto append(const Buffer & b) + static auto append(const ParserBuffer & b) { return b; } template - static auto join(const Buffer &, const Buffer &) + static auto join(const ParserBuffer &, const ParserBuffer &) { - return Buffer(); + return ParserBuffer(); } }; @@ -152,7 +154,7 @@ namespace AdHoc { } static auto innerparse() { - return Buffer(); + return ParserBuffer(); } }; @@ -173,8 +175,8 @@ namespace AdHoc { run(Parser::parse(), s, pn...); } - template class Buffer, typename ... Pn> - static void run(const Buffer &, stream & s, const Pn & ... pn) + template class ParserBuffer, typename ... Pn> + static void run(const ParserBuffer &, stream & s, const Pn & ... pn) { StreamWriter::write(s, pn...); } -- cgit v1.2.3