TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches

Detailed Description

A generic nda::clef::eval function which forwards the evaluation to specialized evaluators.

Classes

struct  nda::clef::evaluator< T, Pairs >
 Generic evaluator for types which do not have a specialized evaluator. More...
 
struct  nda::clef::evaluator< expr< Tag, Childs... >, Pairs... >
 Specialization of nda::clef::evaluator for nda::clef::expr types. More...
 
struct  nda::clef::evaluator< make_fun_impl< T, Is... >, Pairs... >
 Specialization of nda::clef::evaluator for nda::clef::make_fun_impl types. More...
 
struct  nda::clef::evaluator< placeholder< N >, pair< Is, Ts >... >
 Specialization of nda::clef::evaluator for nda::clef::placeholder types. More...
 
struct  nda::clef::evaluator< std::reference_wrapper< T >, Pairs... >
 Specialization of nda::clef::evaluator for std::reference_wrapper types. More...
 

Functions

template<typename T , typename... Pairs>
__inline__ decltype(auto) nda::clef::eval (T const &obj, Pairs &&...pairs)
 Generic function to evaluate expressions and other types.
 

Function Documentation

◆ eval()

template<typename T , typename... Pairs>
__inline__ decltype(auto) nda::clef::eval ( T const & obj,
Pairs &&... pairs )

#include <nda/clef/eval.hpp>

Generic function to evaluate expressions and other types.

Calls the correct nda::clef::evaluator for the given expression/type.

auto ex = i_ + j_;
auto res = nda::clef::eval(ex, i_ = 1, j_ = 2); // int res = 3;
__inline__ decltype(auto) eval(T const &obj, Pairs &&...pairs)
Generic function to evaluate expressions and other types.
Definition eval.hpp:197
A placeholder is an empty struct, labelled by an int.

Here, ex is a binary expression with the + tag and the placeholder i_ and j_ as its child nodes. The eval function calls the correct evaluator for the given expression and the given pairs.

Template Parameters
TType of the expression/object.
PairsTypes of the nda::clef::pair objects.
Parameters
objExpression/object to be evaluated.
pairsnda::clef::pair objects to be applied to the expression.
Returns
The result of the evaluation depending on the type of the expression/object.

Definition at line 197 of file eval.hpp.