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 19:13:49 +0200
On Thu, 19 Feb 2026 at 18:54, Andrey Semashev via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> >> Imagine a library that is using compile_assert. As a user, how you are
> >> supposed to use it, if the compiler is not able to prove all the
> >> compile_asserts? As a maintainer, what are you supposed to do when users
> >> start complaining about the failing asserts on their compilers? What if
> >> the users do indeed want to compile their (and your) code with
> >> optimizations disabled, e.g. to debug a problem? This would be a
> >> terrible idea.
> >
> > I can imagine all sorts of things, including imagining that some
> > programmers can use the right tool for the right
> > job, and don't just mindlessly sprinkle every language feature
> > everywhere in their code, and then complain
> > that some such language feature was a terrible idea. :D
>
> So are you saying that this feature is not intended to be used in
> libraries then?

No, I'm not. But it is intended to be used in libraries different from
what you talk about.

> Because the way it is specified, I cannot see how it
> could be reliably used. If so, then yes, this feature is a terrible idea
> and DOA.

"Doesn't address my domain's needs exactly, so DOA"?

Not that I care, I don't need this facility to be standardized to use it.

Received on 2026-02-19 17:14:04