C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Only reason I don't use std::array

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 17 Aug 2023 11:07:38 -0700
On Thursday, 17 August 2023 11:01:45 PDT Frederick Virchanza Gotham via Std-
Proposals wrote:
> On Thursday, August 17, 2023, Tom Honermann wrote:
> > The code has undefined behavior since
> > no object of std::array<T,len> actually
> > exists at the address returned by
> > pretend_is_std_array().
>
> Yeah but something ABI-compatible with it does. But even if it were
> zero-initialised memory, that can be an array of int's all set to zero.

You're missing the point.

The fact you can get away with it today does not mean you'll always be able
to.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-08-17 18:07:46