Speclib  0.1.2
The library for writing better CUDA libraries
sp::VariableFunctor< F, Children > Class Template Referencefinal

Represents a functor to be applied in the variable system. More...

#include <Var.hpp>

Inheritance diagram for sp::VariableFunctor< F, Children >:
[legend]

Public Types

using Functor = F
 
using ValueType = typename std::conditional_t< ValueTypeIsAny, AnyType, typename InvokeResultIfT<!ValueTypeIsAny, Functor, typename Children::ValueType... >::T >
 
template<typename... NewChildren>
using ReplaceChildren = VariableFunctor< Functor, NewChildren... >
 
- Public Types inherited from sp::VariableUser< VariableFunctor< F, Children... >, Children... >
using Substitute = std::conditional_t< std::is_same_v< VariableFunctor< F, Children... >, Old >, New, typename DeferSubclass< Old >::template ReplaceChildren< typename Children::template Substitute< Old, New >... > >
 Recursively substitute the given old user with the given new user. More...
 
using Vars = typename sp::cat_integer_sequences< typename Children::Vars... >::template sort<>::template unique<>
 The set of unbound variable names. More...
 
using VarType = typename VarTypeHelper< typename Children::template VarType< Name >... >::type
 The type of a named variable. More...
 
using ChildType = typename sp::TypeList< Children... >::template get< I >
 The type of the Ith child. More...
 

Public Member Functions

constexpr VariableFunctor (const Children &... children)
 
constexpr decltype(auto) operator() () const
 Execute the functor with the bound arguments. More...
 
- Public Member Functions inherited from sp::VariableUser< VariableFunctor< F, Children... >, Children... >
constexpr decltype(auto) operator() (Ts &&... values) const
 Calls operator() on the result of binding this object to a set of variables. More...
 
constexpr auto & get ()
 Get the Ith child. More...
 
constexpr const auto & get () const
 Get the Ith child. More...
 
constexpr auto bind (Ts &&... values) const
 Bind a specified set of values to the corresponding variables in this expression. More...
 
constexpr auto bind (Ts &&... values) const
 Bind a set of values to the expression's variables. More...
 
constexpr auto substitute (const New &newValue) const
 Substitute all instances of the given type with the the given new value. More...
 
constexpr auto replaceChildren (NewChildren &&... newChildren) const
 Replace the children of this variable user with the given new children. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sp::VariableUser< VariableFunctor< F, Children... >, Children... >
static constexpr VariableName getUnusedVariableName (int i=0)
 Get an unused variable name. More...
 
- Static Public Attributes inherited from sp::VariableUser< VariableFunctor< F, Children... >, Children... >
static constexpr bool IsFullyBound
 True if there are no unbound variables, and false if there are. More...
 
static constexpr bool IsFullyUnbound
 False if there are any bound variables, and true if there aren't. More...
 
static constexpr int ChildCount
 The number of children. More...
 
- Protected Member Functions inherited from sp::VariableUser< VariableFunctor< F, Children... >, Children... >
constexpr VariableUser (Ts &&... children)
 Copy the arguments into the children tuple. More...
 

Detailed Description

template<typename F, typename... Children>
class sp::VariableFunctor< F, Children >

Represents a functor to be applied in the variable system.

Template Parameters
FA functor representing the operation to perform.
ChildrenThe arguments to the functor.

Member Function Documentation

◆ operator()()

template<typename F , typename... Children>
constexpr decltype(auto) sp::VariableFunctor< F, Children >::operator() ( ) const
constexpr

Execute the functor with the bound arguments.

Returns
The functor's return value.