13#include <rpp/defs.hpp>
14#include <rpp/operators/lift.hpp>
15#include <rpp/operators/fwd/take_while.hpp>
16#include <rpp/subscribers/constraints.hpp>
17#include <rpp/utils/utilities.hpp>
20IMPLEMENTATION_FILE(take_while_tag);
24template<constra
int::decayed_type Type, std::predicate<const Type&> Predicate>
27 RPP_NO_UNIQUE_ADDRESS Predicate predicate;
29 template<
typename TVal, constra
int::subscriber_of_type<Type> TSub>
30 void operator()(TVal&& value,
const TSub& subscriber)
const
32 if (predicate(utils::as_const(value)))
33 subscriber.on_next(std::forward<TVal>(value));
35 subscriber.on_completed();
39template<constra
int::decayed_type Type, std::predicate<const Type&> Predicate>
44 template<constra
int::subscriber TSub>
45 auto operator()(TSub&& subscriber)
const
47 auto subscription = subscriber.get_subscription();
48 return create_subscriber_with_state<Type>(std::move(subscription),
50 utils::forwarding_on_error{},
51 utils::forwarding_on_completed{},
52 std::forward<TSub>(subscriber));
Definition: take_while.hpp:26
Definition: take_while.hpp:41