From d648e27b7fd99fd08ce01f0bfca1fbdf650a786f Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 20 Oct 2022 14:36:28 +0100 Subject: [PATCH] Added has_value() as an alias for is_value() For consistency with STL --- include/etl/result.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/etl/result.h b/include/etl/result.h index 82d0329f..9d79dbf4 100644 --- a/include/etl/result.h +++ b/include/etl/result.h @@ -160,6 +160,14 @@ namespace etl return *this; } + //******************************************* + /// true if result contains a value + //******************************************* + bool has_value() const + { + return (data.index() == 0U); + } + //******************************************* /// true if result contains a value //*******************************************