mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-06 13:09:43 +01:00
util: Add Expected<void, E> specialization
This is not needed, but a bit closer to the std lib, because std::monostate is no longer leaked through ValueType from the value() method.
This commit is contained in:
@@ -66,6 +66,8 @@ BOOST_AUTO_TEST_CASE(expected_error)
|
||||
{
|
||||
Expected<void, std::string> e{};
|
||||
BOOST_CHECK(e.has_value());
|
||||
[&]() -> void { return e.value(); }(); // check value returns void and does not throw
|
||||
[&]() -> void { return *e; }();
|
||||
|
||||
e = Unexpected{"fail"};
|
||||
BOOST_CHECK(!e.has_value());
|
||||
|
||||
Reference in New Issue
Block a user