2011/11/21 Paolo Carlini <paolo.carl...@oracle.com>:
> On 11/21/2011 01:22 AM, Jason Merrill wrote:
>>
>> This bug fix required the following change to
>> libstdc++-v3/include/std/tuple:
>>
>>> -      template<typename... _UElements, typename = typename
>>> -       enable_if<__and_<integral_constant<bool, sizeof...(_UElements)
>>> -                                          == sizeof...(_Elements)>,
>>> -                        __all_convertible<__conv_types<_UElements...>,
>>> -                                          __conv_types<_Elements...>>
>>> - >::value>::type>
>>> +      template<typename... _UElements,
>>> +              typename = typename enable_if<sizeof...(_UElements)
>>> +                                            ==
>>> sizeof...(_Elements)>::type,
>>> +              typename = typename
>>> +                enable_if<__all_convertible<__conv_types<_UElements...>,
>>> +                                            __conv_types<_Elements...>
>>> >::value
>>> + >::type>
>>
>> __and_ doesn't have the shortcut semantics of &&, so checking for equal
>> sizeof... didn't prevent us from trying the __all_convertible test.
>
> Ah!! So, now I'm puzzled: why are we using all those __and_ and __or_ in the
> first place, if isn't because we want to avoid to avoid some instantiations?
> Daniel can you remind me that?

AFAIK in my actual __all_convertible implementation, the second
test was protected by lazy __and_ usage, so this could not happen.
I assume that the defect occurred, when you adapted it to the
existing structure. But of-course the more general

__and_<is_something<_UElements, _Elements>...>

expansion is preferred now.

- Daniel

Reply via email to