diff --git a/Documentation/ITK5MigrationGuide.md b/Documentation/ITK5MigrationGuide.md index a5b06b04d9b..4f6f1a01957 100644 --- a/Documentation/ITK5MigrationGuide.md +++ b/Documentation/ITK5MigrationGuide.md @@ -80,6 +80,7 @@ To modernize your code base, replace: * `FastMutexLock` with `std::mutex`, and `#include "itkFastMutexLock.h"` with `#include `. * `MutexLock` with `std::mutex`, and `#include "itkMutexLock.h"` with `#include `. * `mpl::EnableIf::Type` with `std::enable_if_t`, and `#include "itkEnableIf.h"` with `#include `. + * `mpl::IsSame::Value` with `std::is_same::value`, and `#include "itkIsSame.h"` with `#include `. Modern CMake requirement diff --git a/Modules/Core/Common/include/itkIsSame.h b/Modules/Core/Common/include/itkIsSame.h index 2cb976e5263..3a7019851e9 100644 --- a/Modules/Core/Common/include/itkIsSame.h +++ b/Modules/Core/Common/include/itkIsSame.h @@ -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 { @@ -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 diff --git a/Utilities/Maintenance/BuildHeaderTest.py b/Utilities/Maintenance/BuildHeaderTest.py index a7280bfca2b..7cd755db63d 100755 --- a/Utilities/Maintenance/BuildHeaderTest.py +++ b/Utilities/Maintenance/BuildHeaderTest.py @@ -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",