Re: Proposal: Add more compile-time asserts to expose inconsistencies.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: "Smith, Peter" <peters@fast.au.fujitsu.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-09-19T01:07:40Z
Lists: pgsql-hackers
On Wed, Sep 18, 2019 at 04:46:30PM +0100, Dagfinn Ilmari Mannsåker wrote: > Postgres doesn't seem to have it, but it would be possible to define a > StaticAssertDecl macro that can be used at the file level, outside any > function. See for example Perl's STATIC_ASSERT_DECL: > > https://github.com/Perl/perl5/blob/v5.30.0/perl.h#L3455-L3488 That sounds like a cleaner alternative. Thanks for the pointer. -- Michael
Commits
-
Add declaration-level assertions for compile-time checks
- f1f10a1ba9e1 13.0 landed
-
Add support for static assertions in C++
- a2c8e5cfdb9d 11.0 cited