Blaze 3.9
If.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_MPL_IF_H_
36#define _BLAZE_UTIL_MPL_IF_H_
37
38
39namespace blaze {
40
41//=================================================================================================
42//
43// CLASS DEFINITION
44//
45//=================================================================================================
46
47//*************************************************************************************************
56template< bool Condition > // Compile time selection
57struct If
58{
59 public:
60 //**********************************************************************************************
62 template< typename T1, typename T2 >
63 using Type = T1;
65 //**********************************************************************************************
66};
67//*************************************************************************************************
68
69
70//*************************************************************************************************
79template<>
80struct If<false>
81{
82 public:
83 //**********************************************************************************************
84 template< typename T1, typename T2 >
85 using Type = T2;
86 //**********************************************************************************************
87};
89//*************************************************************************************************
90
91
92//*************************************************************************************************
105template< bool Condition // Compile time selection
106 , typename T1 // Type to be selected if Condition=true
107 , typename T2 > // Type to be selected if Condition=false
108using If_t = typename If<Condition>::template Type<T1,T2>;
109//*************************************************************************************************
110
111} // namespace blaze
112
113#endif
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
Compile time type selection.
Definition: If.h:58