C++ Logo

std-proposals

Advanced search

Re: [std-proposals] P4334R0 C++ Contracts

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sun, 16 Aug 2026 22:44:25 +0300
On Sun, 16 Aug 2026 at 00:31, Jonathan Grant via Std-Proposals
<std-proposals_at_[hidden]> wrote:

> As an experiment, I have implemented contract-like checks in terms of compile_assert().
> https://github.com/jonnygrant/compile_assert/blob/main/testsuite/main28_a.cpp

For what it's worth:
https://godbolt.org/z/WdbbaGsz1

This one isn't sensitive to how much is inlined or not. Which also
means it doesn't benefit any from any inlining
or other optimization. Which means it's not a complete replacement for
your compile_assert.

Received on 2026-08-16 19:44:45