ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkEnableIf.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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> struct EnableIfC {};
60 template <typename TType> struct EnableIfC<true, TType> { typedef TType Type; };
62 
63 
71 template <bool V, typename TType = void> struct DisableIfC {};
73 template <typename TType> struct DisableIfC<false, TType> { typedef TType Type; };
75 
103 template <class TCondition, class TType = void>
104 struct EnableIf : public EnableIfC<TCondition::Value, TType> {};
105 
133 template <class TCondition, class TType = void>
134 struct DisableIf : public DisableIfC<TCondition::Value, TType> {};
135 
136 } // namespace itk::mpl
137 
138 // itk::EnableIf(C), DisableIf(C) have move to itk::mpl
139 // Expect them to be deprecated.
140 using mpl::EnableIf;
141 using mpl::DisableIf;
142 using mpl::EnableIfC;
143 using mpl::DisableIfC;
144 
146 } // namespace itk
147 
148 #endif // itkEnableIf_h
simplified way to dispose of enable_if.
Definition: itkEnableIf.h:104
simplified way to dispose of disable_if.
Definition: itkEnableIf.h:134
An implementation of the negation of the enable if idiom.
Definition: itkEnableIf.h:71