From d8e75d58d967e760994b9b0f656ef22207275874 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 3 Feb 2024 18:07:40 -0500 Subject: [PATCH] expected tests --- src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index ffefaba..b3a9271 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -425,6 +425,14 @@ enum class error struct simple { float f; + + simple(const simple& nontrival) + { + if (nontrival.f < 50) + f = 5000; + else + f = nontrival.f; + } }; blt::expected t1(bool b) @@ -433,7 +441,7 @@ blt::expected t1(bool b) if (b) return f; else - return error::S1; + return blt::unexpected(error::S1); } void init()