13#include <rpp/operators/lift.hpp>
14#include <rpp/operators/fwd/do.hpp>
15#include <rpp/operators/details/subscriber_with_state.hpp>
16#include <rpp/subscribers/constraints.hpp>
17#include <rpp/utils/utilities.hpp>
19IMPLEMENTATION_FILE(do_tag);
23template<constra
int::decayed_type Type, constra
int::observer_of_type<Type> TObs>
28 template<constra
int::subscriber_of_type<Type> TSub>
29 auto operator()(TSub&& subscriber)
const
31 auto subscription = subscriber.get_subscription();
33 return create_subscriber_with_state<Type>(std::move(subscription),
34 [](
auto&& value,
const TSub& subscriber,
const TObs& do_observer)
36 do_observer.on_next(utils::as_const(value));
37 subscriber.on_next(std::forward<
decltype(value)>(value));
39 [](
const std::exception_ptr& err,
40 const TSub& subscriber,
41 const TObs& do_observer)
43 do_observer.on_error(err);
44 subscriber.on_error(err);
46 [](
const TSub& subscriber,
const TObs& do_observer)
48 do_observer.on_completed();
49 subscriber.on_completed();
51 std::forward<TSub>(subscriber),