
Rant: On the C++ std::experimental::variant to come - ingve
http://talesofcpp.fusionfenix.com/post-21/rant-on-the-stdexperimentalvariant-to-come
======
vvanders
This is one area where I think Rust has a clear advantage of no baggage. They
get to represent Some(T) as a null pointer in the None case.

I will say that having being exposed to Rust's Enums(sum types) I don't think
I can ever go back. Combined with pattern matching it's a hell of a combo.

~~~
detrino
This isn't true in general, it's only true when T is a pointer type, in which
case C++ would just use a pointer.

~~~
pcwalton
Or if T is NonZero.

More importantly, dereferencing a None is not undefined behavior in Rust.

~~~
Gankro
Or if T _contains_ a NonZero (Vec, VecDeque, HashMap) ;)

------
n00b101
boost::variant is really interesting and useful in my opinion but it seems to
increase compile times exponentially (to say nothing of compiler error
messages) ... If a language based variant in C++ could solve those issues then
I think that would be really great.

