Fix non default constructible values in compositions

* Add a test case for the non default constructible case
This commit is contained in:
Denis Blank 2018-03-09 05:23:36 +01:00
parent f43a730cbd
commit b50c2bf8a8
2 changed files with 16 additions and 2 deletions

View File

@ -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 <

View File

@ -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__