Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
BindToArgument< SIG, X, pos > Class Template Reference

#include "lib/meta/function-closure.hpp"

Description

template<typename SIG, typename X, uint pos>
class lib::meta::func::BindToArgument< SIG, X, pos >

Bind a specific argument to an arbitrary value.

Notably this "value" might be another binder.

Todo:
6/2025 while this was added later to handle a special case, now after clean-up (see #987) this seems to be the much cleaner implementation approach and can easily be generalised to cover all the general features available through PApply; it would be sufficient to replace the single template parameter X by a type-sequence of the values to bind. All use cases of partial application could be modelled this way... //////////////////////////////////////////////TICKET #1394

Definition at line 405 of file function-closure.hpp.

Static Public Member Functions

template<class FUN , class VAL >
static auto reduced (FUN &&f, VAL &&val)
 

Private Types

enum  { ARG_CNT = count<ArgsList>() }
 
using Args = _Fun< SIG >::Args
 
using Ret = _Fun< SIG >::Ret
 
using ArgsList = Args::List
 
using ValList = Types< X >::List
 
using RemainingFront = Splice< ArgsList, ValList, pos >::Front
 
using RemainingBack = Splice< ArgsList, ValList, pos >::Back
 
using PlaceholdersBefore = func::PlaceholderTuple< RemainingFront >::List
 
using PlaceholdersBehind = func::PlaceholderTuple< RemainingBack, pos+1 >::List
 
using PreparedArgsRaw = typename Append< typename Append< PlaceholdersBefore,ValList >::List,PlaceholdersBehind >::List
 
using PreparedArgs = Prefix< PreparedArgsRaw, ARG_CNT >
 
using ReducedArgs = Append< RemainingFront, RemainingBack >::List
 
using PreparedArgTypes = Types< PreparedArgs >::Seq
 
using RemainingArgs = Types< ReducedArgs >::Seq
 
template<class SRC , class TAR , size_t i>
using IdxSelector = PartiallyInitTuple< SRC, TAR, pos >::template IndexMapper< i >
 
using BuildPreparedArgs = TupleConstructor< PreparedArgTypes, IdxSelector >
 

Member Typedef Documentation

◆ Args

template<typename SIG , typename X , uint pos>
using Args = _Fun<SIG>::Args
private

Definition at line 407 of file function-closure.hpp.

◆ Ret

template<typename SIG , typename X , uint pos>
using Ret = _Fun<SIG>::Ret
private

Definition at line 408 of file function-closure.hpp.

◆ ArgsList

template<typename SIG , typename X , uint pos>
using ArgsList = Args::List
private

Definition at line 409 of file function-closure.hpp.

◆ ValList

template<typename SIG , typename X , uint pos>
using ValList = Types<X>::List
private

Definition at line 410 of file function-closure.hpp.

◆ RemainingFront

template<typename SIG , typename X , uint pos>
using RemainingFront = Splice<ArgsList, ValList, pos>::Front
private

Definition at line 414 of file function-closure.hpp.

◆ RemainingBack

template<typename SIG , typename X , uint pos>
using RemainingBack = Splice<ArgsList, ValList, pos>::Back
private

Definition at line 415 of file function-closure.hpp.

◆ PlaceholdersBefore

template<typename SIG , typename X , uint pos>
using PlaceholdersBefore = func::PlaceholderTuple<RemainingFront>::List
private

Definition at line 416 of file function-closure.hpp.

◆ PlaceholdersBehind

template<typename SIG , typename X , uint pos>
using PlaceholdersBehind = func::PlaceholderTuple<RemainingBack,pos+1>::List
private

Definition at line 417 of file function-closure.hpp.

◆ PreparedArgsRaw

Definition at line 419 of file function-closure.hpp.

◆ PreparedArgs

Definition at line 423 of file function-closure.hpp.

◆ ReducedArgs

template<typename SIG , typename X , uint pos>
using ReducedArgs = Append<RemainingFront, RemainingBack>::List
private

Definition at line 424 of file function-closure.hpp.

◆ PreparedArgTypes

template<typename SIG , typename X , uint pos>
using PreparedArgTypes = Types<PreparedArgs>::Seq
private

Definition at line 426 of file function-closure.hpp.

◆ RemainingArgs

template<typename SIG , typename X , uint pos>
using RemainingArgs = Types<ReducedArgs>::Seq
private

Definition at line 427 of file function-closure.hpp.

◆ IdxSelector

template<typename SIG , typename X , uint pos>
template<class SRC , class TAR , size_t i>
using IdxSelector = PartiallyInitTuple<SRC, TAR, pos>::template IndexMapper<i>
private

Definition at line 431 of file function-closure.hpp.

◆ BuildPreparedArgs

Member Enumeration Documentation

◆ anonymous enum

template<typename SIG , typename X , uint pos>
anonymous enum
private
Enumerator
ARG_CNT 

Definition at line 412 of file function-closure.hpp.

Member Function Documentation

◆ reduced()

template<typename SIG , typename X , uint pos>
template<class FUN , class VAL >
static auto reduced ( FUN &&  f,
VAL &&  val 
)
inlinestatic

Definition at line 440 of file function-closure.hpp.

References lib::meta::func::bindArgTuple().

Referenced by lib::meta::func::bindFirst(), lib::meta::func::bindLast(), and FunctionComposition_test::check_bindToArbitraryParameter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
+ Collaboration diagram for BindToArgument< SIG, X, pos >:

The documentation for this class was generated from the following file: