ona/source/coral/functional.cpp
2023-02-28 00:35:59 +00:00

16 lines
437 B
C++
Executable File

export module coral.functional;
import coral;
export namespace coral {
/**
* Helpful wrapper utility for using in chainable conditionals like [coral::expected::map] to check if a `bool`
* is `true` without writing a lambda.
*/
template<typename value> constexpr auto equality_predicate(value reference_value) {
return [reference_value](value comparing_value) -> bool {
return comparing_value == reference_value;
};
}
}