20 #if !defined(RXCPP_OPERATORS_RX_SKIP_WHILE_HPP) 21 #define RXCPP_OPERATORS_RX_SKIP_WHILE_HPP 23 #include "../rx-includes.hpp" 32 struct skip_while_invalid_arguments {};
35 struct skip_while_invalid :
public rxo::operator_base<skip_while_invalid_arguments<AN...>> {
36 using type = observable<skip_while_invalid_arguments<
AN...>, skip_while_invalid<
AN...>>;
39 using skip_while_invalid_t =
typename skip_while_invalid<
AN...>::type;
41 template<
class T,
class Predicate>
44 typedef rxu::decay_t<T> source_value_type;
45 typedef rxu::decay_t<Predicate> test_type;
54 template<
class Subscriber>
55 struct skip_while_observer
57 typedef skip_while_observer<Subscriber> this_type;
58 typedef source_value_type value_type;
59 typedef rxu::decay_t<Subscriber> dest_type;
60 typedef observer<value_type, this_type> observer_type;
65 skip_while_observer(dest_type d, test_type t)
71 void on_next(source_value_type v) {
81 void on_completed()
const {
85 static subscriber<value_type, observer_type> make(dest_type d, test_type t) {
86 return make_subscriber<value_type>(d, this_type(d, std::move(t)));
90 template<
class Subscriber>
91 auto operator()(Subscriber dest)
const 92 -> decltype(skip_while_observer<Subscriber>::make(std::move(dest), test)) {
93 return skip_while_observer<Subscriber>::make(std::move(dest), test);
101 template<
class...
AN>
112 template<
class Observable,
class Predicate,
114 class TakeWhile = rxo::detail::skip_while<SourceValue, rxu::decay_t<Predicate>>>
115 static auto member(Observable&& o, Predicate&& p)
116 -> decltype(o.template lift<SourceValue>(TakeWhile(std::forward<Predicate>(p)))) {
117 return o.template lift<SourceValue>(TakeWhile(std::forward<Predicate>(p)));
120 template<
class...
AN>
121 static operators::detail::skip_while_invalid_t<
AN...>
member(
const AN&...) {
124 static_assert(
sizeof...(
AN) == 10000,
"skip_while takes (Predicate)");
Definition: rx-operators.hpp:380
std::shared_ptr< util::detail::error_base > error_ptr
Definition: rx-util.hpp:874
Definition: rx-all.hpp:26
typename std::decay< T >::type::value_type value_type_t
Definition: rx-util.hpp:47
Definition: rx-operators.hpp:69
auto AN
Definition: rx-finally.hpp:105
static operators::detail::skip_while_invalid_t< AN... > member(const AN &...)
Definition: rx-skip_while.hpp:121
Definition: rx-operators.hpp:47
auto skip_while(AN &&... an) -> operator_factory< skip_while_tag, AN... >
Discards the first items fulfilling the predicate from this observable emit them from the new observa...
Definition: rx-skip_while.hpp:102
static auto member(Observable &&o, Predicate &&p) -> decltype(o.template lift< SourceValue >(TakeWhile(std::forward< Predicate >(p))))
Definition: rx-skip_while.hpp:115