On 15/10/14 22:06 +0200, François Dumont wrote:
On 15/10/2014 13:10, Jonathan Wakely wrote:
I find this much easier to read:
#if __cplusplus < 201103L
typedef _Is_contiguous_sequence<_Sequence> __tag;
#else
using __lvalref = std::is_lvalue_reference<
typename std::iterator_traits<_InputIterator>::reference>;
using __contiguous = _Is_contiguous_sequence<_Sequence>;
using __tag = typename std::conditional<__lvalref::value,
__contiguous,
std::__false_type>::type;
#endif
return __foreign_iterator_aux3(__it, __other, __other_end, __tag());
It only has one preprocessor condition and it avoids mismatched
parentheses caused by opening the function parameter list once but
closing it twice in two different branches.
That's much better indeed.
Shall we go with this ?
Yes, it looks good to me, thanks.
Of course we are simply considering that
we can't check for foreign iterators when some iterator adapters comes
in-between. I hope one day to detect invalid usages even in this
context.
I agree that's OK.