Date: Sun, 1 May 2022 04:12:38 -0400
This does exactly what you want:
decltype(auto) func(C auto ...args)
On Sun, May 1, 2022 at 4:08 AM Abdullah Qasim via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> But then ALL types are accepted!
>
>
>
> I just want to accept vars of types that comply with concept C
>
>
>
> From: Peter C++ via Std-Proposals
> Sent: 01 May 2022 13:06
> To: std-proposals_at_[hidden]
> Cc: Peter C++
> Subject: Re: [std-proposals] concepts in function param list
>
>
>
> learn the language! available with adding the keyword auto at appropriate place.
>
>
>
>
>
> sent from a mobile device so please excuse strange words due to autocorrection.
>
> Peter Sommerlad
>
> peter.cpp_at_[hidden]
>
> +41-79-432 23 32
>
>
>
> On 1 May 2022, at 10:03, Abdullah Qasim via Std-Proposals <std-proposals_at_[hidden]> 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!
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
decltype(auto) func(C auto ...args)
On Sun, May 1, 2022 at 4:08 AM Abdullah Qasim via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> But then ALL types are accepted!
>
>
>
> I just want to accept vars of types that comply with concept C
>
>
>
> From: Peter C++ via Std-Proposals
> Sent: 01 May 2022 13:06
> To: std-proposals_at_[hidden]
> Cc: Peter C++
> Subject: Re: [std-proposals] concepts in function param list
>
>
>
> learn the language! available with adding the keyword auto at appropriate place.
>
>
>
>
>
> sent from a mobile device so please excuse strange words due to autocorrection.
>
> Peter Sommerlad
>
> peter.cpp_at_[hidden]
>
> +41-79-432 23 32
>
>
>
> On 1 May 2022, at 10:03, Abdullah Qasim via Std-Proposals <std-proposals_at_[hidden]> 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!
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2022-05-01 08:12:52