auto ok = ResultOf!int.ok(1); auto fail = ResultOf!int.fail("Bad", 200); auto init = ResultOf!int.init; auto void_ = Result.ok(); assert(ok.isOk); assert(ok.value == 1); assert(!fail.isOk); assert(fail.error == "Bad"); assert(fail.errorCode == 200); assert(!init.isOk); assert(init.error); assert(void_.isOk);