Move coral::equality_predicate into coral.functional
This commit is contained in:
parent
a2c033107c
commit
6a1eb71ba0
@ -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`.
|
||||
*/
|
||||
|
15
source/coral/functional.cpp
Normal file
15
source/coral/functional.cpp
Normal 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;
|
||||
};
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user