[PATCH] libstdc++: Avoid hard error in ranges::unique_copy [PR100770]

Tim Song t.canens.cpp@gmail.com
Wed May 26 17:27:27 GMT 2021


I noticed that output_iterator_wrapper still has a (non-void)
value_type. Perhaps we can get better coverage if it doesn't have one?
The existing tests should have caught this case with that change, at least.

On Wed, May 26, 2021 at 12:00 PM Patrick Palka via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> -       else if constexpr (input_iterator<_Out>
> -                          && same_as<iter_value_t<_Iter>, iter_value_t<_Out>>)
> +       else if constexpr (requires { requires (input_iterator<_Out>
> +                                               && same_as<iter_value_t<_Iter>,
> +                                                          iter_value_t<_Out>>); })

It's arguably cleaner to extract this into a concept which can then
also be used in the constraint.


More information about the Libstdc++ mailing list