ITK
5.4.0
Insight Toolkit
ITK
Modules
Core
Common
include
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
* https://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
#include "
itkMacro.h
"
22
23
#if !defined(ITK_LEGACY_REMOVE)
24
25
namespace
itk
26
{
28
namespace
mpl
29
{
30
62
template
<
bool
V,
typename
TType =
void
>
63
struct
EnableIfC
64
{};
66
template
<
typename
TType>
67
struct
EnableIfC<true, TType>
68
{
69
using
Type = TType;
70
};
72
73
81
template
<
bool
V,
typename
TType =
void
>
82
struct
DisableIfC
83
{};
85
template
<
typename
TType>
86
struct
DisableIfC<false, TType>
87
{
88
using
Type = TType;
89
};
91
119
template
<
class
TCondition,
class
TType =
void
>
120
struct
EnableIf :
public
EnableIfC<TCondition::Value, TType>
121
{};
122
150
template
<
class
TCondition,
class
TType =
void
>
151
struct
DisableIf :
public
DisableIfC<TCondition::Value, TType>
152
{};
153
154
}
// namespace mpl
155
156
// itk::EnableIf(C), DisableIf(C) have move to itk::mpl
157
// Expect them to be deprecated.
158
using
mpl::EnableIf;
159
using
mpl::DisableIf;
160
using
mpl::EnableIfC;
161
using
mpl::DisableIfC;
162
164
}
// namespace itk
165
166
#else // ITK_LEGACY_REMOVE
167
# error Use C++ 11 std::enable_if directly
168
#endif
169
170
#endif // itkEnableIf_h
itkMacro.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition:
itkAnnulusOperator.h:24
Generated on
unknown
for ITK by
1.8.16