ITK  5.3.0
Insight Toolkit
itkEnableIf.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkEnableIf_h
19 #define itkEnableIf_h
20 
21 namespace itk
22 {
24 namespace mpl
25 {
26 
58 template <bool V, typename TType = void>
59 struct EnableIfC
60 {};
62 template <typename TType>
63 struct EnableIfC<true, TType>
64 {
65  using Type = TType;
66 };
68 
69 
77 template <bool V, typename TType = void>
78 struct DisableIfC
79 {};
81 template <typename TType>
82 struct DisableIfC<false, TType>
83 {
84  using Type = TType;
85 };
87 
115 template <class TCondition, class TType = void>
116 struct EnableIf : public EnableIfC<TCondition::Value, TType>
117 {};
118 
146 template <class TCondition, class TType = void>
147 struct DisableIf : public DisableIfC<TCondition::Value, TType>
148 {};
149 
150 } // namespace mpl
151 
152 // itk::EnableIf(C), DisableIf(C) have move to itk::mpl
153 // Expect them to be deprecated.
154 using mpl::EnableIf;
155 using mpl::DisableIf;
156 using mpl::EnableIfC;
157 using mpl::DisableIfC;
158 
160 } // namespace itk
161 
162 #endif // itkEnableIf_h
itk::EnableIf
simplified way to dispose of enable_if.
Definition: itkEnableIf.h:116
itk::DisableIf
simplified way to dispose of disable_if.
Definition: itkEnableIf.h:147
itk::DisableIfC
An implementation of the negation of the enable if idiom.
Definition: itkEnableIf.h:78
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24