MGIS 3.1.0
Loading...
Searching...
No Matches
mgis::function::internals::BinaryOperatorCurrying< CallableType, SecondEvaluatorType > Struct Template Reference

partial application of a binary operation to the evaluator of its second argument More...

#include </home/runner/work/MFrontGenericInterfaceSupport/MFrontGenericInterfaceSupport/include/MGIS/Function/BinaryOperation.hxx>

Public Types

using Tag = ::mgis::function::EvaluatorModifierTag
 this alias allows to match the Evaluator Modifier concept

Public Member Functions

MGIS_HOST_DEVICE constexpr BinaryOperatorCurrying (const CallableType &, const SecondEvaluatorType &)
 constructor
template<typename FirstEvaluatorType>
requires ( (EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (std::invocable<CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<SecondEvaluatorType>>))
MGIS_HOST_DEVICE constexpr auto operator() (FirstEvaluatorType &&) const
 apply the partially applied binary operation to the evaluator of its first argument

Detailed Description

template<typename CallableType, EvaluatorConcept SecondEvaluatorType>
requires (std::is_copy_constructible_v< CallableType>)
struct mgis::function::internals::BinaryOperatorCurrying< CallableType, SecondEvaluatorType >

partial application of a binary operation to the evaluator of its second argument

This helper matches the EvaluatorModifierConcept concept: applying it to the evaluator of the first argument, with operator| for instance, gives the evaluator of the result of the binary operation. Both the callable object and the evaluator of the second argument are stored in the object.

Template Parameters
CallableTypetype of the binary operation, which must be copy constructible
SecondEvaluatorTypetype of the evaluator used to compute the second argument of the operation

Constructor & Destructor Documentation

◆ BinaryOperatorCurrying()

template<typename CallableType, EvaluatorConcept SecondEvaluatorType>
requires (std::is_copy_constructible_v<CallableType>)
MGIS_HOST_DEVICE constexpr mgis::function::internals::BinaryOperatorCurrying< CallableType, SecondEvaluatorType >::BinaryOperatorCurrying ( const CallableType & c,
const SecondEvaluatorType & e )
constexpr

constructor

stores copies of the callable object and of the evaluator

Parameters
[in]cbinary operation, a copy of which is stored in the object
[in]eevaluator of the second argument of the operation, a copy of which is stored in the object

Member Function Documentation

◆ operator()()

template<typename CallableType, EvaluatorConcept SecondEvaluatorType>
requires ( (EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (std::invocable<CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<SecondEvaluatorType>>))
template<typename FirstEvaluatorType>
requires ( (EvaluatorConcept<std::decay_t<FirstEvaluatorType>>)&& // (std::invocable<CallableType, evaluator_result<std::decay_t<FirstEvaluatorType>>, evaluator_result<SecondEvaluatorType>>))
MGIS_HOST_DEVICE constexpr auto mgis::function::internals::BinaryOperatorCurrying< CallableType, SecondEvaluatorType >::operator() ( FirstEvaluatorType && e1) const
constexpr

apply the partially applied binary operation to the evaluator of its first argument

builds a BinaryOperationModifier from the given evaluator

Template Parameters
FirstEvaluatorTypetype of the evaluator, which may be a qualified type
Parameters
[in]e1evaluator used to compute the first argument of the operation
Returns
a BinaryOperationModifier object, i.e. an evaluator returning the values computed by the binary operation called with the values of the evaluator e1 used to compute the first argument

The documentation for this struct was generated from the following files: