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

partial application of a binary operation to the evaluator of its second argument, without storing the operation 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 BinaryOperatorCurrying2 (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_trivially_default_constructible_v< CallableType>)
struct mgis::function::internals::BinaryOperatorCurrying2< CallableType, SecondEvaluatorType >

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

This helper behaves as BinaryOperatorCurrying except that the callable object is not stored in the object: it must be trivially default constructible. Only the evaluator of the second argument is stored, which allows the predefined modifiers of this file to be defined as constexpr global variables.

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

Constructor & Destructor Documentation

◆ BinaryOperatorCurrying2()

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

constructor

stores a copy of the evaluator of the second argument

Parameters
[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::BinaryOperatorCurrying2< CallableType, SecondEvaluatorType >::operator() ( FirstEvaluatorType && e1) const
constexpr

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

builds a BinaryOperationModifier2 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 BinaryOperationModifier2 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: