C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [isocpp-sg21] Telecon to review P2388R1 Minimum Contract Support: either Ignore or Check_and_abort

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Thu, 23 Sep 2021 16:30:29 +0200
Aaron,

on Thu, 23 Sep 2021 09:25:33 -0400 you (Aaron Ballman
<aaron_at_[hidden]>) wrote:

> On Thu, Sep 23, 2021 at 9:07 AM Jₑₙₛ Gustedt via Liaison
> <liaison_at_[hidden]> wrote:

> > If we seek interface compatibility with C, a function-like syntax
> > with a keyword or identifier and then plain old parenthesis is
> > always the easiest. C can then work around such things with macros
> > that map such a beast do whatever is convenient on the target
> > platform.
>
> I agree, but there is a wrinkle here that we need to be careful of.
> One of the contract conditions is an assertion that's currently
> spelled `assert`, and `assert` followed by an open paren is going to
> be an issue due to the `assert` macro. Using context sensitive
> keywords like above help sidestep that issue by avoiding the open
> paren. Other alternatives exist (like using `Assert` instead of
> `assert`, etc).

yes, but see below

> > C++ clearly has such kind of syntax already (e.g `throw`) and this
> > strategy has worked out well in the past, e.g in shared system
> > headers.

As with the `throw` example, I didn't mean that this should
necessarily be different names for the three features. As someone
already suggested, C++ could just chose `throw`, again.

Once we have `NAME( … something … )`, the distinction between the
different features can be made with the "something" that lives inside
the parenthesis.

Jₑₙₛ

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2021-09-23 09:30:38