What's far more interesting is result
. Yes expected is also legal too. Where things get mind bendy is that v2 result can return a T with additional info E, so you can quite legitimately have a result with both .has_value() and .has_error() returning true. Wasn't this one of the issues people took with Noexcept, that since it works with any return type whatsoever, there is no clear invariant, and you could end up in a situation where you have a value and an error? (I actually agree with this criticism, but in my mind this is a small price to pay for not burdening return objects with transporting errors as well as values.)
The idea, since we no longer have variant storage, is to see if we'd like to implement http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0262r0.html (except with the parameter order reversed). Now, I am fairly sure that .error() is the wrong way to return a status. I am minded that a .status() should do that. I just did a major refactor there as yesterday's code made GCC 6 and VS2017.3 barf. I'm on it. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/