Move coral::equality_predicate into coral.functional

This commit is contained in:
kayomn 2023-02-26 00:39:24 +00:00
parent a2c033107c
commit 6a1eb71ba0
2 changed files with 15 additions and 10 deletions

View File

@ -354,16 +354,6 @@ export namespace coral {
returns(* dispatch)(void *, arguments...);
};
/**
* 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;
};
}
/**
* Monadic container for a descriminating union of either `value_element` or `error_element`.
*/

View File

@ -0,0 +1,15 @@
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;
};
}
}