diff options
author | Grigoriy Chudnov <g.chudnov@gmail.com> | 2016-04-14 17:04:20 +0300 |
---|---|---|
committer | Grigoriy Chudnov <g.chudnov@gmail.com> | 2016-04-14 17:04:20 +0300 |
commit | de3a5d1aeb8f0456dbfc01e2a3189a9197d1a120 (patch) | |
tree | 75938009c00b0e4e021cdd3ffbde503a1e67a7c6 /Rx/v2/src/rxcpp/rx-observable.hpp | |
parent | ad2ad40437fa41af503af89cb6a9d26ebab8bb2f (diff) | |
download | RxCpp-de3a5d1aeb8f0456dbfc01e2a3189a9197d1a120.tar.gz |
add all operator
Diffstat (limited to 'Rx/v2/src/rxcpp/rx-observable.hpp')
-rw-r--r-- | Rx/v2/src/rxcpp/rx-observable.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp index e5d068c..cdeb1e0 100644 --- a/Rx/v2/src/rxcpp/rx-observable.hpp +++ b/Rx/v2/src/rxcpp/rx-observable.hpp @@ -723,6 +723,28 @@ public: return detail_subscribe(make_subscriber<T>(std::forward<ArgN>(an)...)); } + /*! Returns an Observable that emits true if every item emitted by the source Observable satisfies a specified condition, otherwise false. + Emits true if the source Observable terminates without emitting any item. + + \tparam Predicate the type of the test function. + + \param p the test function to test items emitted by the source Observable. + + \return Observable that emits true if every item emitted by the source observable satisfies a specified condition, otherwise false. + + \sample + \snippet all.cpp all sample + \snippet output.txt all sample + */ + template<class Predicate> + auto all(Predicate p) const + /// \cond SHOW_SERVICE_MEMBERS + -> decltype(EXPLICIT_THIS lift<bool>(rxo::detail::all<T, Predicate>(std::move(p)))) + /// \endcond + { + return lift<bool>(rxo::detail::all<T, Predicate>(std::move(p))); + } + /*! Returns an Observable that emits true if any item emitted by the source Observable satisfies a specified condition, otherwise false. Emits false if the source Observable terminates without emitting any item. |