From 1dc8cd000779a07c21eb631472e6061780c84c8c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 9 Dec 2016 14:11:51 +0000 Subject: Simplify the upto buffer --- libadhocutil/compileTimeFormatter.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index 064c4e3..64581ea 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -5,12 +5,12 @@ namespace AdHoc { constexpr int WRAP_AT = 120; - template struct Buffer { }; + template struct Buffer { }; template struct Upto { template - static auto stuff(stream &, const Buffer & f) + static auto stuff(stream &, const Buffer & f) { return f; } @@ -18,54 +18,54 @@ namespace AdHoc { template struct Upto { template - static auto stuff(stream & s, const Buffer &) + static auto stuff(stream & s, const Buffer &) { - return Upto::stuff(s, Buffer()); + return Upto::stuff(s, Buffer()); } }; template struct Upto { template - static auto stuff(stream & s, const Buffer &) + static auto stuff(stream & s, const Buffer &) { s.write(S + start, sizeof...(sm)); - return Buffer(); + return Buffer(); } }; template struct Upto { template - static auto stuff(stream & s, const Buffer &) + static auto stuff(stream & s, const Buffer &) { s.write(S + start, sizeof...(sm)); - return Buffer(); + return Buffer(); } }; template struct Upto { template - static auto stuff(stream & s, const Buffer &) + static auto stuff(stream & s, const Buffer &) { s.write(S + start, sizeof...(sm)); - return Buffer(); + return Buffer(); } }; template struct Upto { template - static auto stuff(stream & s, const Buffer &) + static auto stuff(stream & s, const Buffer &) { s.write(S + start, sizeof...(sm)); - return Buffer(); + return Buffer(); } }; template struct Upto { template - static auto stuff(stream & s, const Buffer &) + static auto stuff(stream & s, const Buffer &) { s.write(S + start, sizeof...(sm)); - return Buffer(); + return Buffer(); } }; @@ -74,10 +74,10 @@ namespace AdHoc { template static void write(stream & s, const Pn & ... pn) { - next(s, Upto::stuff(s, Buffer()), pn...); + next(s, Upto::stuff(s, Buffer<0>()), pn...); } - template class Buffer> - static void next(stream & s, const Buffer&, const Pn & ... pn) + template class Buffer> + static void next(stream & s, const Buffer&, const Pn & ... pn) { StreamWriter::write(s, pn...); } -- cgit v1.2.3