Skip to content
Snippets Groups Projects
Commit abee34d5 authored by Markus Blatt's avatar Markus Blatt
Browse files

Use explicit specialisation for numeric types and let containers

specify types as typedefs.
Someghow I missed this file.

[[Imported from SVN: r6278]]
parent 786e5166
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
#define DUNE_FTRAITS_HH
#include <complex>
#include "typetraits.hh"
namespace Dune {
/**
......@@ -19,11 +19,28 @@ namespace Dune {
struct FieldTraits
{
//! export the type representing the field
typedef T field_type;
typedef typename T::field_type field_type;
//! export the type representing the real type of the field
typedef T real_type;
typedef typename T::real_type real_type;
};
#define ComposeFTraits(p,f,r) \
template<> \
struct FieldTraits<p>{ \
typedef remove_const<f>::type field_type; \
typedef remove_const<r>::type real_type; \
}; \
ComposeFTraits(double,double,double);
ComposeFTraits(float,float,float);
ComposeFTraits(int,int,int);
ComposeFTraits(long,long,long);
ComposeFTraits(std::size_t,std::size_t,std::size_t);
ComposeFTraits(bool,bool,bool);
#undef ComposeFTraits
template<class T>
struct FieldTraits<const T>
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment