Skip to content

Commit 9f3a624

Browse files
committed
ENH: deprecate itk::EnableIf and the header which implements it
It should be replaced by std::enable_if from STL.
1 parent 6b58ee8 commit 9f3a624

File tree

5 files changed

+10
-108
lines changed

5 files changed

+10
-108
lines changed

Documentation/ITK5MigrationGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ To modernize your code base, replace:
7979
* `SimpleFastMutexLock` with `std::mutex`, and `#include "itkSimpleFastMutexLock.h"` with `#include <mutex>`.
8080
* `FastMutexLock` with `std::mutex`, and `#include "itkFastMutexLock.h"` with `#include <mutex>`.
8181
* `MutexLock` with `std::mutex`, and `#include "itkMutexLock.h"` with `#include <mutex>`.
82+
* `mpl::EnableIf<X>::Type` with `std::enable_if_t<X>`, and `#include "itkEnableIf.h"` with `#include <type_traits>`.
8283

8384

8485
Modern CMake requirement

Modules/Core/Common/include/itkEnableIf.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#ifndef itkEnableIf_h
1919
#define itkEnableIf_h
2020

21+
#include "itkMacro.h"
22+
23+
#if !defined(ITK_LEGACY_REMOVE)
24+
2125
namespace itk
2226
{
2327
/// \cond HIDE_META_PROGRAMMING
@@ -159,4 +163,8 @@ using mpl::DisableIfC;
159163
/// \endcond
160164
} // namespace itk
161165

166+
#else // ITK_LEGACY_REMOVE
167+
# error Use C++ 11 std::enable_if directly
168+
#endif
169+
162170
#endif // itkEnableIf_h

Modules/Core/Common/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ itkOptimizerParametersTest.cxx
173173
itkImageVectorOptimizerParametersHelperTest.cxx
174174
itkCompensatedSummationTest.cxx
175175
itkCompensatedSummationTest2.cxx
176-
itkEnableIfTest.cxx
177176
itkImageRegionConstIteratorWithOnlyIndexTest.cxx
178177
itkImageRandomConstIteratorWithOnlyIndexTest.cxx
179178
itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx

Modules/Core/Common/test/itkEnableIfTest.cxx

Lines changed: 0 additions & 107 deletions
This file was deleted.

Utilities/Maintenance/BuildHeaderTest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"itkBSplineDeformableTransform.h", # deprecated
4949
"vtkCaptureScreen.h", # these includes require VTK
5050
"itkMultiThreader.h", # Compatibility file, it should not be used
51+
"itkEnableIf.h", # Compatibility file, it should not be used
5152
"itkViewImage.h", # Depends on VTK_RENDERING_BACKEND
5253
"QuickView.h", # Depends on VTK_RENDERING_BACKEND
5354
"itkBSplineDeformableTransformInitializer.h",

0 commit comments

Comments
 (0)