Skip to content

Commit

Permalink
ENH: deprecate itk::IsSame and the header which implements it
Browse files Browse the repository at this point in the history
It should be replaced by std::is_same from STL.
  • Loading branch information
dzenanz committed Sep 10, 2021
1 parent c28930c commit 342845e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/ITK5MigrationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ To modernize your code base, replace:
* `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>`.
* `mpl::IsSame<X, Y>::Value` with `std::is_same<X, Y>::value`, and `#include "itkIsSame.h"` with `#include <type_traits>`.


Modern CMake requirement
Expand Down
10 changes: 9 additions & 1 deletion Modules/Core/Common/include/itkIsSame.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#ifndef itkIsSame_h
#define itkIsSame_h

#include "itkMetaProgrammingLibrary.h"
#include "itkMacro.h"

#if !defined(ITK_LEGACY_REMOVE)

# include "itkMetaProgrammingLibrary.h"

namespace itk
{
Expand Down Expand Up @@ -50,4 +54,8 @@ using mpl::IsSame;

} // end namespace itk

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

#endif // itkIsSame_h
1 change: 1 addition & 0 deletions Utilities/Maintenance/BuildHeaderTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"vtkCaptureScreen.h", # these includes require VTK
"itkMultiThreader.h", # Compatibility file, it should not be used
"itkEnableIf.h", # Compatibility file, it should not be used
"itkIsSame.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 342845e

Please sign in to comment.