helper applying a stored binary operation to one or two evaluators
More...
#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Function/BinaryOperation.hxx>
|
| MGIS_HOST_DEVICE constexpr | binary_operation_modifier (const CallableType &) |
| | constructor
|
template<typename SecondEvaluatorType>
requires (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>) |
| MGIS_HOST_DEVICE constexpr auto | operator() (SecondEvaluatorType &&) const |
| | partially apply the binary operation to the evaluator of its second argument
|
template<typename FirstEvaluatorType, typename SecondEvaluatorType>
requires ((EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)&& // (std::invocable< CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<std::decay_t<SecondEvaluatorType>>>)) |
| MGIS_HOST_DEVICE constexpr auto | operator() (FirstEvaluatorType &&, SecondEvaluatorType &&) const |
| | build the evaluator of the result of the binary operation
|
template<typename CallableType>
struct mgis::function::internals::binary_operation_modifier< CallableType >
helper applying a stored binary operation to one or two evaluators
The binary operation is stored in the helper. Calling the helper with the evaluator of the second argument only gives a BinaryOperatorCurrying object, i.e. a modifier which is applied to the evaluator of the first argument. Calling the helper with the two evaluators gives the evaluator of the result of the binary operation.
- Template Parameters
-
| CallableType | type of the binary operation, which must be copy constructible |
- Note
- this helper does not match the EvaluatorModifierConcept concept itself: its single argument call operator returns such a modifier
◆ binary_operation_modifier()
template<typename CallableType>
constructor
stores a copy of the callable object
- Parameters
-
| [in] | c | binary operation, a copy of it is stored in the helper |
◆ operator()() [1/2]
template<typename CallableType>
requires ((EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)&& // (std::invocable< CallableType,
evaluator_result<std::decay_t<FirstEvaluatorType>>,
evaluator_result<std::decay_t<SecondEvaluatorType>>>))
template<typename FirstEvaluatorType, typename SecondEvaluatorType>
requires ((EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)&& // (std::invocable< CallableType,
evaluator_result<std::decay_t<FirstEvaluatorType>>,
evaluator_result<std::decay_t<SecondEvaluatorType>>>))
build the evaluator of the result of the binary operation
builds a BinaryOperationModifier from the two evaluators
- Template Parameters
-
| FirstEvaluatorType | type of the evaluator of the first argument, which may be a qualified type |
| SecondEvaluatorType | type of the evaluator of the second argument, which may be a qualified type |
- Parameters
-
| [in] | e1 | evaluator used to compute the first argument |
| [in] | e2 | evaluator used to compute the second argument |
- Returns
- a BinaryOperationModifier object, i.e. an evaluator returning the values computed by the binary operation
◆ operator()() [2/2]
template<typename CallableType>
requires (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)
template<typename SecondEvaluatorType>
requires (EvaluatorConcept<std::decay_t<SecondEvaluatorType>>)
partially apply the binary operation to the evaluator of its second argument
partially applies the operation to the given evaluator
- Template Parameters
-
| SecondEvaluatorType | type of the evaluator, which may be a qualified type |
- Parameters
-
| [in] | e2 | evaluator used to compute the second argument |
- Returns
- a BinaryOperatorCurrying object, which can be applied to the evaluator of the first argument using operator|
The documentation for this struct was generated from the following files: