aboutsummaryrefslogtreecommitdiffstats
path: root/Rx/v2/src/rxcpp/rx-observable.hpp
diff options
context:
space:
mode:
authorGrigoriy Chudnov <g.chudnov@gmail.com>2017-01-11 22:10:36 +0300
committerKirk Shoop <kirk.shoop@microsoft.com>2017-01-11 11:10:36 -0800
commit5af562282f25a500d17da9c283541d7ab33d1785 (patch)
tree0974d1ef1107d658a1eefef809e2676d173c9d42 /Rx/v2/src/rxcpp/rx-observable.hpp
parent13d406282a025f799f7674513dc2222f68d15dd4 (diff)
downloadplatform_external_Reactive-Extensions_RxCpp-5af562282f25a500d17da9c283541d7ab33d1785.tar.gz
platform_external_Reactive-Extensions_RxCpp-5af562282f25a500d17da9c283541d7ab33d1785.tar.bz2
platform_external_Reactive-Extensions_RxCpp-5af562282f25a500d17da9c283541d7ab33d1785.zip
decouple scan from observable (#323)
* decouple scan from observable * fix redefinition bug
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp')
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp23
1 files changed, 5 insertions, 18 deletions
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<class Seed, class Accumulator>
- auto scan(Seed seed, Accumulator&& a) const
+ template<class... AN>
+ auto scan(AN... an) const
/// \cond SHOW_SERVICE_MEMBERS
- -> observable<Seed, rxo::detail::scan<T, this_type, Accumulator, Seed>>
+ -> decltype(observable_member(scan_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
/// \endcond
{
- return observable<Seed, rxo::detail::scan<T, this_type, Accumulator, Seed>>(
- rxo::detail::scan<T, this_type, Accumulator, Seed>(*this, std::forward<Accumulator>(a), seed));
+ return observable_member(scan_tag{}, *this, std::forward<AN>(an)...);
}
/*! @copydoc rx-sample_time.hpp