Blaze  3.6
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 
39 namespace blaze {
40 
41 //=================================================================================================
42 //
43 // CLASS DEFINITION
44 //
45 //=================================================================================================
46 
47 //*************************************************************************************************
56 template< bool Condition // Compile time selection
57  , typename T1 // Type to be selected if Condition=true
58  , typename T2 > // Type to be selected if Condition=false
59 struct If
60 {
61  public:
62  //**********************************************************************************************
64  using Type = T1;
65 
66  //**********************************************************************************************
67 };
68 //*************************************************************************************************
69 
70 
71 //*************************************************************************************************
80 template< typename T1 // Type not to be selected
81  , typename T2 > // Type to be selected
82 struct If<false,T1,T2>
83 {
84  public:
85  //**********************************************************************************************
86  using Type = T2;
87  //**********************************************************************************************
88 };
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
106 template< bool Condition // Compile time selection
107  , typename T1 // Type to be selected if Condition=true
108  , typename T2 > // Type to be selected if Condition=false
110 //*************************************************************************************************
111 
112 } // namespace blaze
113 
114 #endif
Compile time type selection.The If class template selects one of the two given types T1 and T2 depend...
Definition: If.h:59
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58