
On 02/01/18 04:06, VinÃcius dos Santos Oliveira wrote:
2018-01-31 21:02 GMT-03:00 Andrey Semashev via Boost
mailto:boost@lists.boost.org>: It's not the exceptions that made variant difficult. It's *the possibility of a failure* at certain points in some cases. You would have the same difficulty defining behavior in these cases with any error reporting mechanism, exceptions or not.
The way the language features interact makes this hard.
Nope. Nothing about exceptions themselves makes variant hard. And the solution existed in Boost long before std::variant and Rust. It's that not everyone was happy with it and the other side was not happy with the alternatives.
It'd be much simpler if move constructors were forbidden to throw (I'm **not** saying this would be a good rule to have in the language).
Right, but as long as you allow move constructor/assignment to fail, you will have to define behavior when the failure happens. *That* is the difficult part, not handling exceptions or error codes or whatever.