C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Fold expression contains 'if constexpr'

From: Magnus Fromreide <magfr_at_[hidden]>
Date: Tue, 6 Dec 2022 10:36:38 +0100
On Sun, Dec 04, 2022 at 11:13:45PM +0000, Frederick Virchanza Gotham via Std-Proposals wrote:
> On Sun, Dec 4, 2022 at 10:53 PM Thiago Macieira via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>
> > if constexpr ((requires{ get<Types>(p)->Method(a); } || ...))
> > return tailcall(a...);
>
>
> Note that my original function has "auto" as the return type, and so
> the "if else ladder" with the 'constexpr' keyword was able to pick out
> the correct return type.

And this nicely illustrates why one should ask questions about the code
one want help with and not some other code.

/MF

Received on 2022-12-06 09:36:42