Niall Douglas wrote:
template<class T> class result { public:
result(); // T() or error, legitimate fork
result( T const& ); result( T&& );
result( std::error_code const& ) noexcept;
result( result const& ); result( result&& );
result( outcome const& ); //? result( outcome && ); //?
bool has_value() const noexcept; bool has_error() const noexcept;
T value() const; T value() &&;
std::error_code error() const;
explicit operator bool() const noexcept;
void swap( result& ) noexcept; };
That's literally it.
You're missing a few bits of necessary stuff, like equality operators, initialiser list construction and so on.
Equality yes, initializer list no. This works:
#include <vector>
#include
But essentially you've just specified Vicente's Expected there.
I don't think I have. Expected has more members.