Commit b0276d48 authored by Max Lyon's avatar Max Lyon

add documentation for any_of and all_of

parent 4c15ff6e
Pipeline #12705 failed with stages
in 281 minutes and 26 seconds
......@@ -116,6 +116,13 @@ struct SmartRangeT
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>
auto any_of(Functor&& f) -> bool
{
......@@ -126,6 +133,13 @@ struct SmartRangeT
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>
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