Dune Core Modules (2.8.0)

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
8namespace Dune {
23 template <typename T1, typename T2>
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 namespace.
Definition: alignedallocator.hh:11
Compute type of the result of an arithmetic operation involving two different number types.
Definition: promotiontraits.hh:25
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)