[Bug libstdc++/63500] [4.9/5 Regression] bug in debug version of std::make_move_iterator?

Jonathan Wakely jwakely@redhat.com
Wed Oct 15 20:14:00 GMT 2014


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.



More information about the Libstdc++ mailing list