On 31/05/2017 17:42, Vicente J. Botet Escriba wrote:
Le 31/05/2017 à 12:55, Niall Douglas via Boost a écrit :
I guess, ultimately, the question to be answered here is how much like std::variant<...> should Outcome and/or Expected be? std::variant<...> doesn't implement completely unchecked observers like optional's operator*(), the best you can get is a nulled pointer observer, no silent reinterpret_cast.
When I started the Expected proposal Variant was not yet there. I believe that we could add the following from variant: * visit * index * get_if/value_if * get
Apart from the lack of never empty guarantee (which can be worked
around), there appears to be no good reason to not use std::variant