On Sunday, 21 May 2017 at 09:15:56 UTC, Nicholas Wilson wrote:
have free functions

 Result!(T, ErrorEnum) ok(T)(T t) { return Result(t); }
Result!(T, ErrorEnum) error(T)(ErrorEnum e) { return Result(e); }

then go

if (!foo)
    return ok(42);
else
    return error(Error.fooHappened);

Ah, I think you misread. ErrorEnum is a template type, like `T`. There's no ErrorEnum enum specified.

Reply via email to