From b72e15a8d26c9dc215073a1ddc3edc5dc7385083 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 11 Jul 2015 19:30:31 +0100 Subject: [PATCH] properly test for to_format (respect inheritance) --- octa/format.hh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/octa/format.hh b/octa/format.hh index 6982e45..411e712 100644 --- a/octa/format.hh +++ b/octa/format.hh @@ -399,21 +399,11 @@ protected: /* for cusotm container formatting */ -namespace detail { - template - struct ToFmtTest { - template struct Test {}; - template - static char test(Test> *); - template static int test(...); - static constexpr bool value = (sizeof(test(0)) == sizeof(char)); - }; -} - template::value + IsSame().to_format(declval(), + declval())), + bool + >::value >> inline bool to_format(const T &v, R &writer, const FormatSpec &fs) { return v.to_format(writer, fs); }