Skip to content

Commit 68625d9

Browse files
committed
add an overload for unary_operation and transform
1 parent 2ea80bd commit 68625d9

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

include/MGIS/Function/UnaryOperation.hxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,15 @@ namespace mgis::function {
137137
template <typename CallableType>
138138
constexpr auto unary_operation(CallableType&&);
139139

140+
template <typename CallableType, EvaluatorConcept EvaluatorType>
141+
constexpr auto unary_operation(CallableType&&, const EvaluatorType&);
142+
140143
template <typename CallableType>
141144
constexpr auto transform(CallableType&&);
142145

146+
template <typename CallableType, EvaluatorConcept EvaluatorType>
147+
constexpr auto transform(CallableType&&, const EvaluatorType&);
148+
143149
} // end of namespace mgis::function
144150

145151
#include "MGIS/Function/UnaryOperation.ixx"

include/MGIS/Function/UnaryOperation.ixx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,22 @@ namespace mgis::function {
9494
std::forward<CallableType>(c));
9595
} // end of unary_operation
9696

97+
template <typename CallableType, EvaluatorConcept EvaluatorType>
98+
constexpr auto unary_operation(CallableType&& c, const EvaluatorType& e) {
99+
return e | unary_operation(c);
100+
} // end of unary_operation
101+
97102
template <typename CallableType>
98103
constexpr auto transform(CallableType&& c) {
99104
return internals::unary_operation_modifier<std::decay_t<CallableType>>(
100105
std::forward<CallableType>(c));
101106
} // end of transform
102107

108+
template <typename CallableType, EvaluatorConcept EvaluatorType>
109+
constexpr auto transform(CallableType&& c, const EvaluatorType& e) {
110+
return e | transform(c);
111+
} // end of transform
112+
103113
} // end of namespace mgis::function
104114

105115
#endif /* LIB_MGIS_FUNCTION_UNARYOPERATION_IXX */

0 commit comments

Comments
 (0)