13#include <rpp/defs.hpp>
14#include <rpp/operators/lift.hpp>
15#include <rpp/operators/fwd/filter.hpp>
16#include <rpp/subscribers/constraints.hpp>
17#include <rpp/utils/utilities.hpp>
21IMPLEMENTATION_FILE(filter_tag);
25template<constra
int::decayed_type Type, std::predicate<const Type&> Predicate>
28 RPP_NO_UNIQUE_ADDRESS Predicate predicate;
30 template<
typename TVal, constra
int::subscriber_of_type<Type> TSub>
31 void operator()(TVal&& value,
const TSub& subscriber)
const
33 if (predicate(utils::as_const(value)))
34 subscriber.on_next(std::forward<TVal>(value));
38template<constra
int::decayed_type Type, std::predicate<const Type&> Predicate>
43 template<constra
int::subscriber TSub>
44 auto operator()(TSub&& subscriber)
const
46 auto subscription = subscriber.get_subscription();
47 return create_subscriber_with_state<Type>(std::move(subscription),
49 utils::forwarding_on_error{},
50 utils::forwarding_on_completed{},
51 std::forward<TSub>(subscriber));
Definition: filter.hpp:27
Definition: filter.hpp:40