Dune Core Modules (2.6.0)

ftraits.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_FTRAITS_HH
4#define DUNE_FTRAITS_HH
5
10#include <complex>
11#include <vector>
12
13namespace Dune {
14
22 template<class T>
23 struct FieldTraits
24 {
26 typedef T field_type;
28 typedef T real_type;
29 };
30
31 template<class T>
32 struct FieldTraits<const T>
33 {
34 typedef typename FieldTraits<T>::field_type field_type;
35 typedef typename FieldTraits<T>::real_type real_type;
36 };
37
38 template<class T>
39 struct FieldTraits< std::complex<T> >
40 {
41 typedef std::complex<T> field_type;
42 typedef T real_type;
43 };
44
45 template<class T, unsigned int N>
46 struct FieldTraits< T[N] >
47 {
48 typedef typename FieldTraits<T>::field_type field_type;
49 typedef typename FieldTraits<T>::real_type real_type;
50 };
51
52 template<class T>
53 struct FieldTraits< std::vector<T> >
54 {
55 typedef typename FieldTraits<T>::field_type field_type;
56 typedef typename FieldTraits<T>::real_type real_type;
57 };
58
59} // end namespace Dune
60
61#endif // DUNE_FTRAITS_HH
Dune namespace.
Definition: alignedallocator.hh:10
STL namespace.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 26, 23:30, 2024)