On Fri, Mar 1, 2019 at 5:50 PM Robert Ramey via Boost
C++ starts from the idea that every instance should be mutable and hence gives you an assignment operator by default. The design discussions around variant (expected, outcome, ...) presume that this operation must be implemented. I question this. Not only for variant, but for many other C++ data types.
Robert Ramey
It is part history, part performance, for example your immutable integers work fine and fast, but if you had immutable strings and pushback was O(n) or string was no longer an array that would be problematic. As for variant2: I personally hate std::variant since valueless_by_exception is something like std::bad_alloc(nobody tests for that like Niall said). Also can the author compare variant2 with https://github.com/cbeck88/strict-variant (that looks nice from my reading of documentation). regards, Ivan