C++ Logo

std-proposals

Advanced search

Re: [std-proposals] concepts in function param list

From: Bo Persson <bo_at_[hidden]>
Date: Sun, 1 May 2022 20:51:10 +0200
On 2022-05-01 at 10:03, Abdullah Qasim via Std-Proposals wrote:
> Why must we do this:
>
> // concept C
>
> template <C ...T >
>
> decltype(auto) func (T ...args)
>
> {
>
> return args + ...;
>
> }
>
> So unnecessary!
>
> Why not:
>
> decltype(auto) func (C ...args)
>
> {
>
> Return args + ...;
>
> }
>
> ??
>
> Not hard to implement, as auto in param list is already implemented.
>
> This would help lots, & would speed up coding, making it more
> maintainable too!
>
>

This has already been considered by the committee and rejected on the
grounds that we cannot easily see that func is a template. How do we
know if C is a concept or a type?

Received on 2022-05-01 18:55:04