summaryrefslogtreecommitdiff
path: root/Rx/v2/src/rxcpp/rx-observable.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp')
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp42
1 files changed, 15 insertions, 27 deletions
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp
index f82a8e0..5e11b67 100644
--- a/Rx/v2/src/rxcpp/rx-observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-observable.hpp
@@ -2087,29 +2087,6 @@ public:
return observable_member(take_tag{}, *this, std::forward<AN>(an)...);
}
- /*! Emit only the final t items emitted by the source Observable.
-
- \tparam Count the type of the items counter
-
- \param t the number of last items to take
-
- \return An observable that emits only the last 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_last.cpp take_last sample
- \snippet output.txt take_last sample
- */
- template<class Count>
- auto take_last(Count t) const
- /// \cond SHOW_SERVICE_MEMBERS
- -> observable<T, rxo::detail::take_last<T, this_type, Count>>
- /// \endcond
- {
- return observable<T, rxo::detail::take_last<T, this_type, Count>>(
- rxo::detail::take_last<T, this_type, Count>(*this, t));
- }
-
-
/*! For each item from this observable until on_next occurs on the trigger observable, emit them from the new observable that is returned.
\tparam TriggerSource the type of the trigger observable
@@ -2209,15 +2186,26 @@ public:
return take_until(rxs::timer(when, cn), cn);
}
+ /*! @copydoc rx-take_last.hpp
+ */
+ template<class... AN>
+ auto take_last(AN&&... an) const
+ /// \cond SHOW_SERVICE_MEMBERS
+ -> decltype(observable_member(take_last_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
+ /// \endcond
+ {
+ return observable_member(take_last_tag{}, *this, std::forward<AN>(an)...);
+ }
+
/*! @copydoc rx-take_while.hpp
*/
template<class... AN>
auto take_while(AN&&... an) const
- /// \cond SHOW_SERVICE_MEMBERS
- -> decltype(observable_member(take_while_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
- /// \endcond
+ /// \cond SHOW_SERVICE_MEMBERS
+ -> decltype(observable_member(take_while_tag{}, *(this_type*)nullptr, std::forward<AN>(an)...))
+ /// \endcond
{
- return observable_member(take_while_tag{}, *this, std::forward<AN>(an)...);
+ return observable_member(take_while_tag{}, *this, std::forward<AN>(an)...);
}
/*! @copydoc rx-repeat.hpp