to string conversion
alias R = Result!int; const R r1; assert(r1.toString == "invalid"); const R r2 = 42; assert(r2.toString == "42");
result of uncopyable type
alias T = Uncopyable; alias R = Result!T; R r1; assert(!r1); assert(r1 == R.invalid); assert(r1 != R(T.init)); assert(!r1.isValid); T t = T(42); r1 = move(t); assert(r1 != R(T.init)); assert(*r1 == T(42)); R r2 = T(43); assert(*r2 == T(43)); assert(r2.value == T(43));
Result of T. Designed for error handling where an operation can either succeed or fail. - TODO: Add member toRange alias with opSlice - TODO: Add member visit()