dune-common
2.6-git
dune
common
promotiontraits.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_PROMOTIONTRAITS_HH
4
#define DUNE_PROMOTIONTRAITS_HH
5
6
#include <utility>
7
8
namespace
Dune
{
23
template
<
typename
T1,
typename
T2>
24
struct
PromotionTraits
25
{
26
typedef
decltype(std::declval<T1>()+std::declval<T2>())
PromotedType
;
27
};
28
29
// Specialization for the case of two equal types
30
// One should think that the generic template should handle this case as well.
31
// However, the fvectortest.cc unit test fails without it if ENABLE_GMP is set.
32
template <typename T1>
33
struct
PromotionTraits
<T1,T1> {
typedef
T1
PromotedType
; };
34
36
}
// end namespace
37
38
39
#endif // DUNE_PROMOTIONTRAITS_HH
Dune
Dune namespace.
Definition:
alignedallocator.hh:9
Dune::PromotionTraits
Compute type of the result of an arithmetic operation involving two different number types.
Definition:
promotiontraits.hh:24
Dune::PromotionTraits< T1, T1 >::PromotedType
T1 PromotedType
Definition:
promotiontraits.hh:33
Dune::PromotionTraits::PromotedType
decltype(std::declval< T1 >()+std::declval< T2 >()) typedef PromotedType
Definition:
promotiontraits.hh:26
Generated by
1.8.17