Skip to content
Snippets Groups Projects
ftraits.hh 1.07 KiB
Newer Older
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_FTRAITS_HH
#define DUNE_FTRAITS_HH

Oliver Sander's avatar
Oliver Sander committed
/** \file
 * \brief Type traits to determine the type of reals (when working with complex numbers)
 */

     @addtogroup DenseMatVec
Oliver Sander's avatar
Oliver Sander committed
     \brief Type traits to retrieve the field and the real type of classes
Oliver Sander's avatar
Oliver Sander committed
     Type traits to retrieve the field and the real type of classes
     e.g. that of FieldVector or FieldMatrix
   */
  template<class T>
  struct FieldTraits
  {
    //! export the type representing the field
    //! export the type representing the real type of the field
  };

  template<class T>
  struct FieldTraits<const T>
  {
    typedef typename FieldTraits<T>::field_type field_type;
    typedef typename FieldTraits<T>::real_type real_type;
  };

  template<class T>
  struct FieldTraits< std::complex<T> >
  {
    typedef std::complex<T> field_type;
    typedef T real_type;
  };

} // end namespace Dune

#endif // DUNE_FTRAITS_HH