Searched defs:OkOrFail (Results 1 – 1 of 1) sorted by relevance
218 struct OkOrFail<std::optional<T>> { struct219 using opt_t = std::optional<T>;223 static bool IsOk(const opt_t& opt) { return opt.has_value(); } in IsOk()224 static T Unwrap(opt_t&& opt) { return std::move(opt.value()); } in Unwrap()225 static std::string ErrorMessage(const opt_t&) { return "Empty optional"; } in ErrorMessage()226 static void Fail(opt_t&&) {} in Fail()