2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Add context menu support to info members list.

This commit is contained in:
John Preston
2017-10-22 20:06:57 +03:00
parent 856ca22aad
commit fb46c33d7f
15 changed files with 366 additions and 76 deletions

View File

@@ -66,6 +66,14 @@ template <
true_t test_callable_tuple(
Method &&,
std::tuple<Types...> &&) noexcept;
template <
typename Method,
typename ...Types,
typename = decltype(std::declval<Method>()(
const_ref_val<Types>()...))>
true_t test_callable_tuple(
Method &&,
const std::tuple<Types...> &) noexcept;
false_t test_callable_tuple(...) noexcept;
template <typename Method, typename Arg>

View File

@@ -213,6 +213,25 @@ TEST_CASE("basic operators tests", "[rpl::operators]") {
}
REQUIRE(*sum == "1 1 3 ");
}
SECTION("filter tuple test") {
auto sum = std::make_shared<std::string>("");
{
auto lifetime = single(std::make_tuple(1, 2))
| then(single(std::make_tuple(1, 2)))
| then(single(std::make_tuple(2, 3)))
| then(single(std::make_tuple(2, 3)))
| then(single(std::make_tuple(3, 4)))
| filter([](auto first, auto second) { return first != 2; })
| map([](auto first, auto second) {
return std::to_string(second);
})
| start_with_next([=](std::string &&value) {
*sum += std::move(value) + ' ';
});
}
REQUIRE(*sum == "2 2 4 ");
}
SECTION("distinct_until_changed test") {
auto sum = std::make_shared<std::string>("");