Here is an example in my code, using std::optional
:
Max = index(summary_max.value(), clusters[summary_max.value()]->Maximum().value());
Here, summary_max
and Maximum()
is std::optional
. This is WAY verbose.
I want to type just index(summary_max, clusters[summary_max]->Maximum());
Why doesn't std::optional<T>
support implicit casting to T
? Is there any valid, inevitable rationale?