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

#include <nda/clef/expression.hpp>

Detailed Description

template<typename Tag, typename... Ts>
struct nda::clef::expr< Tag, Ts >

Single node of the expression tree.

An expression node contains a tag that determines the type of expression and a tuple of child nodes which are usually either other expression nodes, nda::clef::placeholder objects or specific values/objects like an int or a double.

Template Parameters
TagTag of the expression.
TsTypes of the child nodes.

Definition at line 76 of file expression.hpp.

Public Types

using childs_t = std::tuple<Ts...>
 Tuple type for storing the child nodes.
 

Public Member Functions

 expr (expr &&ex) noexcept
 Move constructor simply moves the child nodes from the source expression.
 
 expr (expr const &)=default
 Default copy constructor.
 
template<typename... Us>
 expr (Tag, Us &&...us)
 Construct an expression node with a given tag and child nodes.
 
template<typename... Args>
auto operator() (Args &&...args) const
 Function call operator.
 
exproperator= (expr &&)=default
 Default move assignment operator.
 
exproperator= (expr const &)=delete
 Copy assignment operator is deleted.
 
template<typename... Args>
auto operator[] (Args &&...args) const
 Subscript operator.
 

Public Attributes

childs_t childs
 Child nodes of the current expression node.
 

Constructor & Destructor Documentation

◆ expr() [1/2]

template<typename Tag , typename... Ts>
nda::clef::expr< Tag, Ts >::expr ( expr< Tag, Ts > && ex)
inlinenoexcept

Move constructor simply moves the child nodes from the source expression.

Parameters
exSource expression.

Definition at line 90 of file expression.hpp.

◆ expr() [2/2]

template<typename Tag , typename... Ts>
template<typename... Us>
nda::clef::expr< Tag, Ts >::expr ( Tag ,
Us &&... us )
inline

Construct an expression node with a given tag and child nodes.

Template Parameters
UsTypes of the child nodes.
Parameters
usChild nodes.

Definition at line 105 of file expression.hpp.

Member Function Documentation

◆ operator()()

template<typename Tag , typename... Ts>
template<typename... Args>
auto nda::clef::expr< Tag, Ts >::operator() ( Args &&... args) const
inline

Function call operator.

Template Parameters
ArgsTypes of the function call arguments.
Parameters
argsFunction call arguments.
Returns
An nda::clef::expr object with the nda::clef::tags::function tag containing the current expression node as the first child node and the other arguments as the remaining child nodes.

Definition at line 129 of file expression.hpp.

◆ operator[]()

template<typename Tag , typename... Ts>
template<typename... Args>
auto nda::clef::expr< Tag, Ts >::operator[] ( Args &&... args) const
inline

Subscript operator.

Template Parameters
ArgsTypes of the subscript arguments.
Parameters
argsSubscript arguments.
Returns
An nda::clef::expr object with the nda::clef::tags::subscript tag containing the current expression node as the first child node and the other arguments as the remaining child nodes.

Definition at line 116 of file expression.hpp.


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