[PATCH 3/3] libstdc++: Implement C++20 range adaptors

Stephan Bergmann sbergman@redhat.com
Tue Feb 18 20:11:00 GMT 2020


On 18/02/2020 12:56, Jonathan Wakely wrote:
> Does this solve the problem, and work with both compilers?
> 
> diff --git a/libstdc++-v3/include/std/ranges 
> b/libstdc++-v3/include/std/ranges
> index b9ac528fdff..481ba75ee5e 100644
> --- a/libstdc++-v3/include/std/ranges
> +++ b/libstdc++-v3/include/std/ranges
> @@ -1102,6 +1102,9 @@ namespace views
>            }
>         };
> 
> +    template<typename _Callable>
> +      _RangeAdaptor(_Callable) -> _RangeAdaptor<_Callable>;
> +
>       template<typename _Callable>
>         struct _RangeAdaptorClosure : public _RangeAdaptor<_Callable>
>         {
> 
> 
> With this deduction guide CTAD should work, without having to consider
> the constraints on the constructors.

Yes, that indeed compiles with both GCC and Clang.



More information about the Libstdc++ mailing list