C++ Logo

std-proposals

Advanced search

Re: C++ create a class with array members which arenot constructed.

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Thu, 3 Sep 2020 01:08:13 +0300
On Thu, 3 Sep 2020 at 00:54, Steve Hearnden via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> This proposal is to provide a syntax where the intent of the space / memory is more clear, and the developer can then focus on implementing their requirements, rather than hiding their intent from the compiler.

I utterly fail to see how using std::optional hides intent from the
compiler. Half of its motivating use cases are like
the one you depicted, delaying the initialization of a value-object's
value despite deciding its type and size early.

> Using an attribute, would keep it away from being commonly used, or easy to stumble across (unlike the union)

I don't understand what you mean by that.

Received on 2020-09-02 17:11:53