Phi
conditional.hpp
1 #ifndef INCG_PHI_CORE_TYPE_TRAITS_CONDITIONAL_HPP
2 #define INCG_PHI_CORE_TYPE_TRAITS_CONDITIONAL_HPP
3 
4 #include "phi/phi_config.hpp"
5 
6 #if PHI_HAS_EXTENSION_PRAGMA_ONCE()
7 # pragma once
8 #endif
9 
10 DETAIL_PHI_BEGIN_NAMESPACE()
11 
12 template <bool Bool, typename TrueT, typename FalseT>
14 {
15  using type = TrueT;
16 };
17 
18 template <typename TrueT, typename FalseT>
19 struct conditional<false, TrueT, FalseT>
20 {
21  using type = FalseT;
22 };
23 
24 template <bool Bool, typename TrueT, typename FalseT>
25 using conditional_t = typename conditional<Bool, TrueT, FalseT>::type;
26 
27 DETAIL_PHI_END_NAMESPACE()
28 
29 #endif // INCG_PHI_CORE_TYPE_TRAITS_CONDITIONAL_HPP
Definition: conditional.hpp:13
Definition: common_type.hpp:40