expected tests

main
Brett 2024-02-03 18:07:40 -05:00
parent 298c640d03
commit d8e75d58d9
1 changed files with 9 additions and 1 deletions

View File

@ -425,6 +425,14 @@ enum class error
struct simple struct simple
{ {
float f; float f;
simple(const simple& nontrival)
{
if (nontrival.f < 50)
f = 5000;
else
f = nontrival.f;
}
}; };
blt::expected<float, error> t1(bool b) blt::expected<float, error> t1(bool b)
@ -433,7 +441,7 @@ blt::expected<float, error> t1(bool b)
if (b) if (b)
return f; return f;
else else
return error::S1; return blt::unexpected(error::S1);
} }
void init() void init()