C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Fwd: zero overhead for std::optional

From: Peter Neiss <peter.stefan.neiss_at_[hidden]>
Date: Sat, 4 Apr 2026 20:16:36 +0200
Hello Sebastian,
it's not intrusive and it would be very bad when you had to modify your
type to use it. It should naturally have an "invalid" value. I am still not
sure about the ABI Problem. A NTTP should never reach the linker, but maybe
there a reason or bad design decisions so that it does.
So i could live with std::slim_optional

Am Sa., 4. Apr. 2026 um 20:09 Uhr schrieb Sebastian Wittmeier via
Std-Proposals <std-proposals_at_[hidden]>:

> I think std::maybe is a sub-optimal choice with std::optional around.
>
>
>
> Better
>
> std::inband_optional or
>
> std::optional_inband or
>
> std::intrusive_optional or
>
> std::optional_intrusive
>
>
>
> so that the close relationship, but also the difference to std::optional
> is clear.
>
>
>
> (I think to actually be intrusive it would have to be used differently
> than as a template<valuetype>, rather class valuetype : public
> optional_intrusive)
>
>
> -----Ursprüngliche Nachricht-----
> *Von:* Peter Neiss via Std-Proposals <std-proposals_at_[hidden]>
> *Gesendet:* Sa 04.04.2026 19:47
> *Betreff:* [std-proposals] Fwd: zero overhead for std::optional
> *An:* std-proposals_at_[hidden];
> *CC:* Peter Neiss <peter.stefan.neiss_at_[hidden]>;
> Thanks Guy,
> I read the ISO AI document and agree with it fully. I checked the AI
> generated code and documents.
> If ABI will be a mayor issue, std::maybe could be an alternative name. I
> dont see an alternative for an additional NTTP template parameter.
> When there is interest in the proposal, what would i have to do next to
> get a proper N???? number and which study Group should I contact.
> Help appreciated,
> Peter
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2026-04-04 18:16:50