Commit b0276d48 authored by Max Lyon's avatar Max Lyon
Browse files

add documentation for any_of and all_of

parent 4c15ff6e
...@@ -116,6 +116,13 @@ struct SmartRangeT ...@@ -116,6 +116,13 @@ struct SmartRangeT
return (1.0 / n_elements) * sum; return (1.0 / n_elements) * sum;
} }
/** @brief Check if any element fulfils condition.
*
* Checks if functor \p f returns true for any of the elements in the range.
* Returns true if that is the case, false otherwise.
*
* @param f Functor that is evaluated for all elements.
*/
template <typename Functor> template <typename Functor>
auto any_of(Functor&& f) -> bool auto any_of(Functor&& f) -> bool
{ {
...@@ -126,6 +133,13 @@ struct SmartRangeT ...@@ -126,6 +133,13 @@ struct SmartRangeT
return false; return false;
} }
/** @brief Check if all elements fulfil condition.
*
* Checks if functor \p f returns true for all of the elements in the range.
* Returns true if that is the case, false otherwise.
*
* @param f Functor that is evaluated for all elements.
*/
template <typename Functor> template <typename Functor>
auto all_of(Functor&& f) -> bool auto all_of(Functor&& f) -> bool
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment