mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 01:36:46 +08:00
Fix non default constructible values in compositions
* Add a test case for the non default constructible case
This commit is contained in:
parent
f43a730cbd
commit
b50c2bf8a8
@ -56,13 +56,14 @@ struct all_hint_deducer {
|
||||
|
||||
template <typename First>
|
||||
static constexpr auto deduce(hints::signature_hint_tag<First>) {
|
||||
return First{};
|
||||
return std::declval<First>();
|
||||
}
|
||||
|
||||
template <typename First, typename Second, typename... Args>
|
||||
static constexpr auto
|
||||
deduce(hints::signature_hint_tag<First, Second, Args...>) {
|
||||
return spread_this(First{}, Second{}, Args{}...);
|
||||
return spread_this(std::declval<First>(), std::declval<Second>(),
|
||||
std::declval<Args>()...);
|
||||
}
|
||||
|
||||
template <
|
||||
|
||||
@ -49,12 +49,25 @@ void test_all_seq_op(Supplier&& supply, OperatorConnector&& op) {
|
||||
}
|
||||
}
|
||||
|
||||
class non_default_constructible {
|
||||
public:
|
||||
explicit non_default_constructible(int) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Supplier, typename AggregateConnector>
|
||||
void test_all_seq_aggregate(Supplier&& supply, AggregateConnector&& ag) {
|
||||
{
|
||||
auto chain = ag(supply(1, 2), supply(3, 4), supply(5, 6));
|
||||
EXPECT_ASYNC_RESULT(std::move(chain), 1, 2, 3, 4, 5, 6);
|
||||
}
|
||||
|
||||
{
|
||||
auto chain =
|
||||
ag(supply(1, 2), supply(non_default_constructible{1}), supply(5, 6));
|
||||
ASSERT_ASYNC_TYPES(std::move(chain), int, int, non_default_constructible,
|
||||
int, int);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // TEST_CONTINUABLE_CONNECTION_HPP__
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user