aboutsummaryrefslogtreecommitdiffstats
path: root/Rx/v2/src/rxcpp/rx-observable.hpp
diff options
context:
space:
mode:
authorGrigoriy Chudnov <g.chudnov@gmail.com>2016-12-29 16:42:22 +0300
committerKirk Shoop <kirk.shoop@microsoft.com>2016-12-29 10:11:40 -0800
commit588e3ac01c655e224f095c264b6fe90c09381005 (patch)
tree2e4d7a57931fdc998583d29f4430ed944bbba3c6 /Rx/v2/src/rxcpp/rx-observable.hpp
parentc62234770349a638e0296ca0ceca137b4147af06 (diff)
downloadplatform_external_Reactive-Extensions_RxCpp-588e3ac01c655e224f095c264b6fe90c09381005.tar.gz
platform_external_Reactive-Extensions_RxCpp-588e3ac01c655e224f095c264b6fe90c09381005.tar.bz2
platform_external_Reactive-Extensions_RxCpp-588e3ac01c655e224f095c264b6fe90c09381005.zip
decouple take from observable
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp')
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp
index 761aa7f..bdd847a 100644
--- a/Rx/v2/src/rxcpp/rx-observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-observable.hpp
@@ -2517,26 +2517,15 @@ public:
rxo::detail::skip_until<T, this_type, TriggerSource, Coordination>(*this, std::forward<TriggerSource>(t), std::forward<Coordination>(cn)));
}
- /*! For the first count items from this observable emit them from the new observable that is returned.
-
- \tparam Count the type of the items counter
-
- \param t the number of items to take
-
- \return An observable that emits only the first t items emitted by the source Observable, or all of the items from the source observable if that observable emits fewer than t items.
-
- \sample
- \snippet take.cpp take sample
- \snippet output.txt take sample
- */
- template<class Count>
- auto take(Count t) const
+ /*! @copydoc rx-take.hpp
+ */
+ template<class... AN>
+ auto take(AN... an) const
/// \cond SHOW_SERVICE_MEMBERS
- -> observable<T, rxo::detail::take<T, this_type, Count>>
+ -> decltype(observable_member(take_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
/// \endcond
{
- return observable<T, rxo::detail::take<T, this_type, Count>>(
- rxo::detail::take<T, this_type, Count>(*this, t));
+ return observable_member(take_tag{}, *this, std::forward<AN>(an)...);
}
/*! Emit only the final t items emitted by the source Observable.