This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] First bits of the algo merge
Hi Howard,
and thanks for the review.
> I'm wondering if this shouldn't be:
>
> __glibcxx_function_requires(_LessThanOpConcept<_ValueType2,
> _ValueType1>);
[snip]
>> @@ -3635,11 +3691,16 @@
>> includes(_InputIterator1 __first1, _InputIterator1 __last1,
>> _InputIterator2 __first2, _InputIterator2 __last2)
>> {
>> + typedef typename iterator_traits<_InputIterator1>::value_type
>> + _ValueType1;
>> + typedef typename iterator_traits<_InputIterator2>::value_type
>> + _ValueType2;
>> +
>> // concept requirements
>> - __glibcxx_function_requires(_LessThanComparableConcept<
>> - typename iterator_traits<_InputIterator1>::value_type>)
>> - return std::includes(__first1, __last1, __first2, __last2,
>> - __gnu_cxx::__ops::less());
>> + __glibcxx_function_requires
>> (_LessThanComparableConcept<_ValueType1>)
>> +
>> + return std::includes(__first1, __last1, __first2, __last2,
>> + __gnu_cxx::__ops::less<_ValueType1, _ValueType2>());
>> }
>>
> // Set algorithms: includes, set_union, set_intersection,
> set_difference,
>
> And this:
>
> __glibcxx_function_requires(_LessThanOpConcept<_ValueType1,
> _ValueType2>)
> __glibcxx_function_requires(_LessThanOpConcept<_ValueType2,
> _ValueType1>)
You are spot on! Actually however, you are arguing about different
functions than I touched (as regards concept checks), about which I
meant to ask later ;)
Indeed, there is a whole series of functions, those that you pointed
out, which have got a very strong (too strong)
_SameTypeConcept<_ValueType1, _ValueType2> in the predicated version of
the algorithm (e.g., includes, set_*, etc.). Because of that, I believe
_LessThanComparableConcept<_ValueType1> is currently equivalent to what
you are suggesting.
Therefore, the real question is: shall we remove
_SameTypeConcept<_ValueType1, _ValueType2> from the predicated version,
in those cases? Let's reach an agreement about that and let's go ahead
with this part of the work!
Thanks,
Paolo.