Make exception and empty results returning a void hint

This commit is contained in:
Denis Blank 2018-11-25 17:14:23 +01:00
parent 782e1c6447
commit 2a80649084
2 changed files with 22 additions and 6 deletions

View File

@ -229,7 +229,7 @@ auto invoker_of(Hint, traits::identity<empty_result>) {
std::forward<decltype(next_callback)>(next_callback));
CONTINUABLE_BLOCK_TRY_END*/
},
Hint{});
traits::identity<>{});
}
/// - exceptional_result -> Hint
@ -246,7 +246,7 @@ auto invoker_of(Hint, traits::identity<exceptional_result>) {
std::forward<decltype(next_callback)>(next_callback));
CONTINUABLE_BLOCK_TRY_END*/
},
Hint{});
traits::identity<>{});
}
/// - result<Args...> -> Args...

View File

@ -178,7 +178,12 @@ TEST(result_copyable_tests, is_copy_assignable) {
TYPED_TEST(result_all_tests, is_constructible_from_error_helper) {
cti::exceptional_result e1(supply_test_exception());
{ auto e2 = e1; }
{
TypeParam e2 = e1;
EXPECT_FALSE(bool(e2));
EXPECT_FALSE(e2.is_value());
EXPECT_TRUE(e2.is_exception());
}
auto e2 = std::move(e1);
TypeParam e(std::move(e2));
@ -190,7 +195,12 @@ TYPED_TEST(result_all_tests, is_constructible_from_error_helper) {
TYPED_TEST(result_all_tests, is_assignable_from_error_helper) {
cti::exceptional_result e1(supply_test_exception());
{ auto e2 = e1; }
{
TypeParam e2 = e1;
EXPECT_FALSE(bool(e2));
EXPECT_FALSE(e2.is_value());
EXPECT_TRUE(e2.is_exception());
}
auto e2 = std::move(e1);
TypeParam e;
@ -203,7 +213,10 @@ TYPED_TEST(result_all_tests, is_assignable_from_error_helper) {
TYPED_TEST(result_all_tests, is_constructible_from_empty_helper) {
cti::empty_result e1;
{ auto e2 = e1; }
{
auto e2 = e1;
(void)e2;
}
auto e2 = std::move(e1);
TypeParam e(std::move(e2));
@ -215,7 +228,10 @@ TYPED_TEST(result_all_tests, is_constructible_from_empty_helper) {
TYPED_TEST(result_all_tests, is_assignable_from_empty_helper) {
cti::empty_result e1;
{ auto e2 = e1; }
{
auto e2 = e1;
(void)e2;
}
auto e2 = std::move(e1);
TypeParam e;