dune-common 3.0-git
type_traits.hh
Go to the documentation of this file.
1#ifndef DUNE_COMMON_STD_TYPE_TRAITS_HH
2#define DUNE_COMMON_STD_TYPE_TRAITS_HH
3
4#include <type_traits>
5
6namespace Dune
7{
8
9namespace Std
10{
11
12 // to_false_type
13 // -------------
14
58 template< typename T >
59 struct to_false_type : public std::false_type {};
60
61
62
63 // to_true_type
64 // ------------
65
74 template< typename T >
75 struct to_true_type : public std::true_type {};
76
77
78#if __cpp_lib_bool_constant
79
80 using std::bool_constant;
81
82#elif __cpp_lib_experimental_bool_constant
83
84 using std::experimental::bool_constant;
85
86#else
87
93 template <bool value>
94 using bool_constant = std::integral_constant<bool, value>;
95
96#endif
97
98} // namespace Std
99
100} // namespace Dune
101
102#endif // #ifndef DUNE_COMMON_STD_TYPE_TRAITS_HH
Dune namespace.
Definition alignment.hh:11
std::integral_constant< bool, value > bool_constant
A template alias for std::integral_constant<bool, value>
Definition type_traits.hh:94
template mapping a type to std::false_type
Definition type_traits.hh:59
template mapping a type to std::true_type
Definition type_traits.hh:75