Dune Core Modules (unstable)

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 // SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5 #ifndef DUNE_FTRAITS_HH
6 #define DUNE_FTRAITS_HH
7 
12 #include <complex>
13 #include <vector>
14 
15 namespace Dune {
16 
24  template<class T>
25  struct FieldTraits
26  {
28  typedef T field_type;
30  typedef T real_type;
31  };
32 
33  template<class T>
34  struct FieldTraits<const T>
35  {
36  typedef typename FieldTraits<T>::field_type field_type;
37  typedef typename FieldTraits<T>::real_type real_type;
38  };
39 
40  template<class T>
41  struct FieldTraits< std::complex<T> >
42  {
43  typedef std::complex<T> field_type;
44  typedef T real_type;
45  };
46 
47  template<class T, unsigned int N>
48  struct FieldTraits< T[N] >
49  {
50  typedef typename FieldTraits<T>::field_type field_type;
51  typedef typename FieldTraits<T>::real_type real_type;
52  };
53 
54  template<class T>
55  struct FieldTraits< std::vector<T> >
56  {
57  typedef typename FieldTraits<T>::field_type field_type;
58  typedef typename FieldTraits<T>::real_type real_type;
59  };
60 
61 } // end namespace Dune
62 
63 #endif // DUNE_FTRAITS_HH
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 27, 22:29, 2024)