Skip to content

Commit

Permalink
ENH: deprecate itk::EnableIf and the header which implements it
Browse files Browse the repository at this point in the history
It should be replaced by std::enable_if from STL.
  • Loading branch information
dzenanz committed Sep 9, 2021
1 parent 6b58ee8 commit 9f3a624
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 108 deletions.
1 change: 1 addition & 0 deletions Documentation/ITK5MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ To modernize your code base, replace:
* `SimpleFastMutexLock` with `std::mutex`, and `#include "itkSimpleFastMutexLock.h"` with `#include <mutex>`.
* `FastMutexLock` with `std::mutex`, and `#include "itkFastMutexLock.h"` with `#include <mutex>`.
* `MutexLock` with `std::mutex`, and `#include "itkMutexLock.h"` with `#include <mutex>`.
* `mpl::EnableIf<X>::Type` with `std::enable_if_t<X>`, and `#include "itkEnableIf.h"` with `#include <type_traits>`.


Modern CMake requirement
Expand Down
8 changes: 8 additions & 0 deletions Modules/Core/Common/include/itkEnableIf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#ifndef itkEnableIf_h
#define itkEnableIf_h

#include "itkMacro.h"

#if !defined(ITK_LEGACY_REMOVE)

namespace itk
{
/// \cond HIDE_META_PROGRAMMING
Expand Down Expand Up @@ -159,4 +163,8 @@ using mpl::DisableIfC;
/// \endcond
} // namespace itk

#else // ITK_LEGACY_REMOVE
# error Use C++ 11 std::enable_if directly
#endif

#endif // itkEnableIf_h
1 change: 0 additions & 1 deletion Modules/Core/Common/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ itkOptimizerParametersTest.cxx
itkImageVectorOptimizerParametersHelperTest.cxx
itkCompensatedSummationTest.cxx
itkCompensatedSummationTest2.cxx
itkEnableIfTest.cxx
itkImageRegionConstIteratorWithOnlyIndexTest.cxx
itkImageRandomConstIteratorWithOnlyIndexTest.cxx
itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx
Expand Down
107 changes: 0 additions & 107 deletions Modules/Core/Common/test/itkEnableIfTest.cxx

This file was deleted.

1 change: 1 addition & 0 deletions Utilities/Maintenance/BuildHeaderTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"itkBSplineDeformableTransform.h", # deprecated
"vtkCaptureScreen.h", # these includes require VTK
"itkMultiThreader.h", # Compatibility file, it should not be used
"itkEnableIf.h", # Compatibility file, it should not be used
"itkViewImage.h", # Depends on VTK_RENDERING_BACKEND
"QuickView.h", # Depends on VTK_RENDERING_BACKEND
"itkBSplineDeformableTransformInitializer.h",
Expand Down

0 comments on commit 9f3a624

Please sign in to comment.