From 17b4f3384b040b615a620fb719c0dcd78f81a45f Mon Sep 17 00:00:00 2001 From: 134579 Date: Tue, 12 Nov 2024 11:28:02 +0800 Subject: [PATCH] cast to bool --- result.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/result.h b/result.h index 8480860..3422f6d 100644 --- a/result.h +++ b/result.h @@ -746,6 +746,10 @@ struct Result { storage_.destroy(details::err_tag()); } + inline explicit operator bool() const { + return ok_; + } + bool isOk() const { return ok_; }