LTL  2.0.x
Public Types | Public Member Functions | List of all members
ltl::ExprBase< Derived_T, N_Dims > Struct Template Reference

Inherited by ltl::MArray< TDAT, 2 >, and ltl::MArray< TDAT, NDIM >.

Public Types

enum  { dims = N_Dims }
 

Public Member Functions

 ExprBase ()
 
 ExprBase (const ExprBase &)
 
Derived_T & derived ()
 
const Derived_T & derived () const
 

Detailed Description

template<typename Derived_T, int N_Dims>
struct ltl::ExprBase< Derived_T, N_Dims >

Base class for all operands in expression templates. Both nodes and leafs of expressions inherit from this type.

This class uses the Curiously Recurring Template Pattern (CRTP) to implement "compile-time polymorphism" by taking the derived type as a template parameter and providing a method derived() to cast itself to the derived type.

The rank of the expression operand is made explicit through the second template parameter N_Dims to allow strict type checking on the rank in functions that accept ExprBase objects as parameters (e.g. make sure that parameters have the same rank, or some predetermined rank).

Member Enumeration Documentation

template<typename Derived_T, int N_Dims>
anonymous enum
Enumerator
dims 

Constructor & Destructor Documentation

template<typename Derived_T, int N_Dims>
ltl::ExprBase< Derived_T, N_Dims >::ExprBase ( )
inline
template<typename Derived_T, int N_Dims>
ltl::ExprBase< Derived_T, N_Dims >::ExprBase ( const ExprBase< Derived_T, N_Dims > &  )
inline

Member Function Documentation

template<typename Derived_T, int N_Dims>
Derived_T& ltl::ExprBase< Derived_T, N_Dims >::derived ( )
inline
template<typename Derived_T, int N_Dims>
const Derived_T& ltl::ExprBase< Derived_T, N_Dims >::derived ( ) const
inline