Namespaces
Variants
Views
Actions

Talk:cpp/utility/optional/and then

From cppreference.com
< Talk:cpp‎ | utility‎ | optional
Revision as of 01:03, 9 November 2021 by 194.74.130.171 (Talk)

Why do these methods require that the return type is drived from std::optional? It would be far more convenient if the method itself constructed the optional and more in keeping with convenient syntax in other languages such as C#: a?.foo()?.bar()?.baz(). It also requires a default constructible result type, which is another needles(?) restriction.

Never mind - The method I was expecting is called "transform".