C++ Logo

std-proposals

Advanced search

Re: [std-proposals] all bytes zero == null object

From: Heckerpowered <heckerpowered_at_[hidden]>
Date: Tue, 23 Jul 2024 01:48:32 +0800
> On Jul 23, 2024, at 01:37, 李 秋逸 <QiuyiLi1023_at_[hidden]> wrote:
>
> 
> There are three serious mistakes in your reply.
>
> First, you creat a const reference refer to an object whitch is infact not exist.
>
> Second, you ignore the access specifiers.
>
> Last and the most important, what we need is a magic value to "creat" a unvalid state, not just a function which even cannot always return true when the object is unvalid.

First of all, I apologize for the mistakes in my implementation.

At the beginning of this topic, std::optional needs an additional bytes to flag to determine whether a element is empty, so I think it’s not necessarily to use a magic value to determine whether a std::optional is empty.

Received on 2024-07-22 17:48:49