mirror of
https://github.com/Naios/continuable.git
synced 2026-02-17 07:39:49 +08:00
Make exception and empty results returning a void hint
This commit is contained in:
parent
782e1c6447
commit
2a80649084
@ -229,7 +229,7 @@ auto invoker_of(Hint, traits::identity<empty_result>) {
|
|||||||
std::forward<decltype(next_callback)>(next_callback));
|
std::forward<decltype(next_callback)>(next_callback));
|
||||||
CONTINUABLE_BLOCK_TRY_END*/
|
CONTINUABLE_BLOCK_TRY_END*/
|
||||||
},
|
},
|
||||||
Hint{});
|
traits::identity<>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// - exceptional_result -> Hint
|
/// - exceptional_result -> Hint
|
||||||
@ -246,7 +246,7 @@ auto invoker_of(Hint, traits::identity<exceptional_result>) {
|
|||||||
std::forward<decltype(next_callback)>(next_callback));
|
std::forward<decltype(next_callback)>(next_callback));
|
||||||
CONTINUABLE_BLOCK_TRY_END*/
|
CONTINUABLE_BLOCK_TRY_END*/
|
||||||
},
|
},
|
||||||
Hint{});
|
traits::identity<>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// - result<Args...> -> Args...
|
/// - result<Args...> -> Args...
|
||||||
|
|||||||
@ -178,7 +178,12 @@ TEST(result_copyable_tests, is_copy_assignable) {
|
|||||||
|
|
||||||
TYPED_TEST(result_all_tests, is_constructible_from_error_helper) {
|
TYPED_TEST(result_all_tests, is_constructible_from_error_helper) {
|
||||||
cti::exceptional_result e1(supply_test_exception());
|
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);
|
auto e2 = std::move(e1);
|
||||||
|
|
||||||
TypeParam e(std::move(e2));
|
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) {
|
TYPED_TEST(result_all_tests, is_assignable_from_error_helper) {
|
||||||
cti::exceptional_result e1(supply_test_exception());
|
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);
|
auto e2 = std::move(e1);
|
||||||
|
|
||||||
TypeParam e;
|
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) {
|
TYPED_TEST(result_all_tests, is_constructible_from_empty_helper) {
|
||||||
cti::empty_result e1;
|
cti::empty_result e1;
|
||||||
{ auto e2 = e1; }
|
{
|
||||||
|
auto e2 = e1;
|
||||||
|
(void)e2;
|
||||||
|
}
|
||||||
auto e2 = std::move(e1);
|
auto e2 = std::move(e1);
|
||||||
|
|
||||||
TypeParam e(std::move(e2));
|
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) {
|
TYPED_TEST(result_all_tests, is_assignable_from_empty_helper) {
|
||||||
cti::empty_result e1;
|
cti::empty_result e1;
|
||||||
{ auto e2 = e1; }
|
{
|
||||||
|
auto e2 = e1;
|
||||||
|
(void)e2;
|
||||||
|
}
|
||||||
auto e2 = std::move(e1);
|
auto e2 = std::move(e1);
|
||||||
|
|
||||||
TypeParam e;
|
TypeParam e;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user