proj home

Files   Classes   Functions   Hierarchy  

typeop< T > Class Template Reference

Template type operator class. More...

#include <typeop.h>

Inheritance diagram for typeop< T >:

List of all members.

Public Types

typedef T Targ
typedef T Tbare
typedef T const Tconst
typedef TTref
typedef TTbareref
typedef T const & Tconstref
typedef TTptr
typedef TTbareptr
typedef T const * Tconstptr


Detailed Description

template<typename T>
class typeop< T >

Template type operator class.

At compile time templates type can be extracted or manipulated. This is critical in using template techniques.

For example removing a reference of a template argument to use the type to access the classes typedef template declaration.

Example
template< typename FN, typename XI, typename T >
class explore 
{
public:

  typedef T Ttype;
...

template< typename EXP >
class pattern
{
...
  // Strip away the reference in EXP if it exists.
  cirbuffarr< typename typeop<EXP>::Tbare::Ttype > xi0;
...
};

  // Use of a reference causes compiler problems as a type.  
  pattern< explore<parab2 &,double*,double> & > pat(g);
The idea for the classes comes from C++ Templates The Complete Guide by D. Vandevoorde and N. Josuttis ISBN 0-201-73484-2. 15.2.3 References and Qualifiers, pages 268-271.

Definition at line 42 of file typeop.h.


Member Typedef Documentation

template<typename T>
typedef T typeop< T >::Targ

Definition at line 46 of file typeop.h.

template<typename T>
typedef T typeop< T >::Tbare

Definition at line 47 of file typeop.h.

template<typename T>
typedef T* typeop< T >::Tbareptr

Definition at line 53 of file typeop.h.

template<typename T>
typedef T& typeop< T >::Tbareref

Definition at line 50 of file typeop.h.

template<typename T>
typedef T const typeop< T >::Tconst

Definition at line 48 of file typeop.h.

template<typename T>
typedef T const* typeop< T >::Tconstptr

Definition at line 54 of file typeop.h.

template<typename T>
typedef T const& typeop< T >::Tconstref

Definition at line 51 of file typeop.h.

template<typename T>
typedef T* typeop< T >::Tptr

Definition at line 52 of file typeop.h.

template<typename T>
typedef T& typeop< T >::Tref

Definition at line 49 of file typeop.h.


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

Generated on Fri Mar 4 00:50:22 2011 for Chelton Evans Source by  doxygen 1.5.8