From 5af562282f25a500d17da9c283541d7ab33d1785 Mon Sep 17 00:00:00 2001 From: Grigoriy Chudnov Date: Wed, 11 Jan 2017 22:10:36 +0300 Subject: decouple scan from observable (#323) * decouple scan from observable * fix redefinition bug --- Rx/v2/src/rxcpp/rx-observable.hpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp') diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp index 81a626a..52acb15 100644 --- a/Rx/v2/src/rxcpp/rx-observable.hpp +++ b/Rx/v2/src/rxcpp/rx-observable.hpp @@ -1921,28 +1921,15 @@ public: static_assert(sizeof...(AN) == 0, "min() was passed too many arguments."); } - /*! For each item from this observable use Accumulator to combine items into a value that will be emitted from the new observable that is returned. - - \tparam Seed the type of the initial value for the accumulator - \tparam Accumulator the type of the data accumulating function - - \param seed the initial value for the accumulator - \param a an accumulator function to be invoked on each item emitted by the source observable, whose result will be emitted and used in the next accumulator call - - \return An observable that emits the results of each call to the accumulator function. - - \sample - \snippet scan.cpp scan sample - \snippet output.txt scan sample + /*! @copydoc rx-scan.hpp */ - template - auto scan(Seed seed, Accumulator&& a) const + template + auto scan(AN... an) const /// \cond SHOW_SERVICE_MEMBERS - -> observable> + -> decltype(observable_member(scan_tag{}, *(this_type*)nullptr, std::forward(an)...)) /// \endcond { - return observable>( - rxo::detail::scan(*this, std::forward(a), seed)); + return observable_member(scan_tag{}, *this, std::forward(an)...); } /*! @copydoc rx-sample_time.hpp -- cgit v1.2.3