TBCI::tbci_traits< T > Class Template Reference

#include <tbci_traits.h>

List of all members.

Public Types

typedef T & refval_type
typedef const T & const_refval_type
typedef T & loop_refval_type
typedef const T & loop_const_refval_type


Detailed Description

template<typename T>
class TBCI::tbci_traits< T >

This traits class is there to make some tradeoffs: How should variables of a type T be passed best, as const reference or by value? How should we store the variable when we use it in a loop, as reference to the original value or as copy?

The answer to these questions is encapsulated in the class tbci_traits.

refval_type and const_refval_type are for passing variables. loop_refval_type and loop_const_refval_type are for access in loops.

The answer may be dependent on the exact machine that's being used. In general, small POD types that fit into a CPU(FPU) register should best be passed as value always.

Small entities that fit into a small number of registers (such as complex numbers) may best be passed to function by reference, but if accessed multiple times, the one copy is cheaper than the indirection by pointer.

For unknown types, that can be arbitrarily complex, and large, we default to using references.

Definition at line 44 of file tbci_traits.h.


Member Typedef Documentation

template<typename T>
typedef T& TBCI::tbci_traits< T >::refval_type

Definition at line 47 of file tbci_traits.h.

template<typename T>
typedef const T& TBCI::tbci_traits< T >::const_refval_type

Definition at line 48 of file tbci_traits.h.

template<typename T>
typedef T& TBCI::tbci_traits< T >::loop_refval_type

Definition at line 49 of file tbci_traits.h.

template<typename T>
typedef const T& TBCI::tbci_traits< T >::loop_const_refval_type

Definition at line 50 of file tbci_traits.h.


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

Generated on Wed Nov 20 09:29:40 2013 for TBCI Numerical high perf. C++ Library by  doxygen 1.5.6