On Mon, 20 Nov 2023 at 00:32, Magnus Fromreide via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
Hello!

When I saw the failable API's the first question I asked myself was why you
choose to use T* as return type rather than
std::optional<std::reference_wrapper<T>> or possibly

That would look pretty silly if we get std::optional<T&> in C++26. Working around the absence of optional<T&> like this would be a pretty ugly kluge.

If we do get optional<T&>, I think it would be reasonable to ask why it's not used there.

 
std::expected<std::reference_wrapper<T>, void>

The error_type of std::expected can't be void.