From 232f6266732e624af676f8d17043d6f1a0b3f272 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 30 Aug 2018 21:05:31 +0100 Subject: Simplify CTF bad format handling static assertion is now just the default behaviour, not a catch all template class --- libadhocutil/compileTimeFormatter.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index 4fcb1cb..1e2a99c 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -38,6 +38,11 @@ namespace AdHoc { template struct StreamWriter { + template + static void write(stream &, const Pn & ...) + { + static_assert(!L, "invalid format string/arguments"); + } }; template @@ -79,16 +84,6 @@ namespace AdHoc { } }; - // Unknown stream writer formatter - template - struct StreamWriter { - template - static void write(stream & s, const Pn & ...) - { - static_assert(!&s, "invalid format string/arguments"); - } - }; - template static inline void appendStream(stream & s, const char_type * p, size_t n) { -- cgit v1.2.3