From fe6325d5e356b93daa9e0b2c23ffd3e0f57bdcd2 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 23 May 2015 22:27:57 +0100 Subject: [PATCH] check for input range before checking for put() - avoid potential false positives --- octa/range.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/octa/range.h b/octa/range.h index 2f28d7a..799fadb 100644 --- a/octa/range.h +++ b/octa/range.h @@ -87,11 +87,12 @@ namespace octa { static constexpr bool value = (sizeof(__octa_test(0)) == sizeof(char)); }; - template, OutputRangeTag>::value || - __OctaOutputRangeTest &>::value || - __OctaOutputRangeTest &&>::value) - > struct IsOutputRange: False {}; + template, OutputRangeTag + >::value || (IsInputRange::value && + (__OctaOutputRangeTest &>::value || + __OctaOutputRangeTest &&>::value) + ))> struct IsOutputRange: False {}; template struct IsOutputRange: True {};