From 595b63672bb8e8a40af06c0bc32e5ee432697793 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 9 Dec 2016 14:21:26 +0000 Subject: Simplify the upto writers --- libadhocutil/compileTimeFormatter.h | 44 ++++++++----------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index 64581ea..1543058 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -23,51 +23,25 @@ namespace AdHoc { return Upto::stuff(s, Buffer()); } }; - template - struct Upto { + template + struct UptoWrite { template 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 &) - { - s.write(S + start, sizeof...(sm)); - return Buffer(); - } - }; + struct Upto : public UptoWrite { }; + template + struct Upto : public UptoWrite { }; template - struct Upto { - template - static auto stuff(stream & s, const Buffer &) - { - s.write(S + start, sizeof...(sm)); - return Buffer(); - } - }; + struct Upto : public UptoWrite { }; template - struct Upto { - template - static auto stuff(stream & s, const Buffer &) - { - s.write(S + start, sizeof...(sm)); - return Buffer(); - } - }; + struct Upto : public UptoWrite { }; template - struct Upto { - template - static auto stuff(stream & s, const Buffer &) - { - s.write(S + start, sizeof...(sm)); - return Buffer(); - } - }; + struct Upto : public UptoWrite { }; template struct StreamWriter { -- cgit v1.2.3