C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Use optional<T> as though it were T

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Tue, 4 Jul 2023 19:01:42 +0100
On Tuesday, July 4, 2023, Frederick Virchanza Gotham wrote:

> Well maybe they could all be static functions instead of member
> functions.
>


Or another possibility:

You must use 'std::direct' to access the holder object. For example:

    std::optional_direct<T> obj;

    std::direct(obj).emplace("monkey", 5);

Received on 2023-07-04 18:01:45