C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Bo Persson Re: noexcept({ if constexpr (cond) { ... } else { ... } })

From: Bingzhi <bingzhi2025_at_[hidden]>
Date: Mon, 10 Aug 2026 22:15:41 +0800 (CST)
But lambda is slower in compilation speed. That noexcept({ if constexpr (cond) { ... } else { ... } }) idea is to support something like short-circuit ternary operator inside noexcept, to achieve faster compilation speed when using large scale template libraries.

At 2026-08-10 20:00:08, std-proposals-request_at_[hidden] wrote:
>Message: 4
>Date: Mon, 10 Aug 2026 12:36:29 +0200
>From: Bo Persson <bo_at_[hidden]>
>To: std-proposals_at_[hidden]rg
>Subject: Re: [std-proposals] noexcept({ if constexpr (cond) { ... }
> else { ... } })
>Message-ID: <115c9jd$nef$1_at_[hidden]>
>Content-Type: text/plain; charset=UTF-8; format=flowed
>
>On 2026-08-10 at 11:45, Bingzhi via Std-Proposals wrote:
>> Somebody who tried to implement ranges library can get what I mean.
>> I prefer noexcept(auto) than this one, but I believe this one is simpler
>> to achieve.
>>
>
>You can already use a lambda in the noexcept(), like
>
>noexcept([] {if (cond) return something; else return other; }() )
>

Received on 2026-08-10 14:15:50