C++ Logo

std-proposals

Advanced search

Re: [std-proposals] compile_assert() a static assert that fires at compile time, not runtime.

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Thu, 19 Feb 2026 17:17:14 +0200
On Thu, 19 Feb 2026 at 17:12, Jan Schultke <janschultke_at_[hidden]> wrote:
>
> I can't bring myself not to think of it as a "false positive". compile_assert is asking the question "Is it known at compile time that this condition is true?"
>
> There are cases where the answer is yes, but the compiler can't prove it

So the answer is no.

> One could say that this feature has no false positives and false negatives when phrasing what compile_assert does in terms of compiler mechanics, but that doesn't seem helpful.

It's immensely helpful for users of this existing facility.

Whether it's helpful for someone aspiring to standardize the facility
is separate from that.

Received on 2026-02-19 15:17:28