C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] Multidimensional subscript operator

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Fri, 30 Apr 2021 16:39:15 +0200
will,

on Fri, 30 Apr 2021 10:12:26 -0400 you (will wray <wjwray_at_[hidden]>)
wrote:

> > If C++ wouldn't allow the declaration of VLA, fine,
> > maybe C could even remove that possibility.
>
> What is needed is a safer way to manage stack-
> allocated data, in both C and in C++.
> Only then should VLA be deprecated.
>
> The stack allocation that VLA provides
> is preferable to the alternative; alloca

indeed, `alloca` is much worse ;-)

But I would state the need differently, not in terms of "stack"
(what's that ?-) but in terms of functionality.

We need a possibility to allocate named objects of dynamic size that
have the lifetime of the scope in which they are defined and where the
mechanism provides runtime testing for failure. With the proposed
`defer` construct C is moving very slowly in that direction.

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-04-30 09:39:22