util: Implement Expected::operator*()&&

It is currently unused, but implementing it is closer to std::expected.
This commit is contained in:
MarcoFalke
2025-12-09 16:17:56 +01:00
parent fab9721430
commit fabb47e4e3
2 changed files with 10 additions and 2 deletions

View File

@@ -50,6 +50,13 @@ BOOST_AUTO_TEST_CASE(expected_value_rvalue)
BOOST_CHECK_EQUAL(*moved, 5);
}
BOOST_AUTO_TEST_CASE(expected_deref_rvalue)
{
Expected<std::unique_ptr<int>, int> no_copy{std::make_unique<int>(5)};
const auto moved{*std::move(no_copy)};
BOOST_CHECK_EQUAL(*moved, 5);
}
BOOST_AUTO_TEST_CASE(expected_value_or)
{
Expected<std::unique_ptr<int>, int> no_copy{std::make_unique<int>(1)};