Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::Predicate Concept Referenceexport

A callable type that returns a boolean value. More...

#include <callable.h>

Concept definition

template<typename F, typename... Args>
std::convertible_to<std::invoke_result_t<F, Args...>, bool>
A callable type that can be invoked with given arguments.
Definition callable.h:62
A callable type that returns a boolean value.
Definition callable.h:137

Detailed Description

A callable type that returns a boolean value.

Use this concept for filter functions, condition checks, and boolean predicates.

Example usage:

template<typename T, Predicate<const T&> P>
bool any_of(const std::vector<T>& vec, P&& pred) {
for (const auto& item : vec) {
if (pred(item)) return true;
}
return false;
}

Definition at line 137 of file callable.h.