From 3e62740becac26bbeead14c63895438dd86e7cf5 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Thu, 28 Nov 2024 18:08:49 +0100 Subject: [PATCH] ENH: ITK_FUTURE_DEPRECATED for SetGlobalInstance and Singleton overloads These specific "deprecated" warnings should not appear when legacy support is enabled. --- Modules/Core/Common/include/itkSingleton.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Modules/Core/Common/include/itkSingleton.h b/Modules/Core/Common/include/itkSingleton.h index a2b2c280844a..19dcf014fe45 100644 --- a/Modules/Core/Common/include/itkSingleton.h +++ b/Modules/Core/Common/include/itkSingleton.h @@ -78,12 +78,12 @@ class ITKCommon_EXPORT SingletonIndex #ifndef ITK_FUTURE_LEGACY_REMOVE template - [[deprecated("Prefer calling the SetGlobalInstance(globalName, global, deleteFunc) overload (without the unused func " - "parameter)!")]] bool - SetGlobalInstance(const char * globalName, - T * global, - std::function itkNotUsed(func), - std::function deleteFunc) + ITK_FUTURE_DEPRECATED("Prefer calling the SetGlobalInstance(globalName, global, deleteFunc) overload (without the " + "unused func parameter)!") + bool SetGlobalInstance(const char * globalName, + T * global, + std::function itkNotUsed(func), + std::function deleteFunc) { this->SetGlobalInstance(globalName, global, std::move(deleteFunc)); // Just returns true for backward compatibility (legacy only). @@ -148,8 +148,9 @@ Singleton(const char * globalName, std::function deleteFunc) #ifndef ITK_FUTURE_LEGACY_REMOVE template -[[deprecated("Prefer calling the Singleton(globalName, deleteFunc) overload (without the unused func parameter)!")]] T * -Singleton(const char * globalName, std::function itkNotUsed(func), std::function deleteFunc) +ITK_FUTURE_DEPRECATED( + "Prefer calling the Singleton(globalName, deleteFunc) overload (without the unused func parameter)!") +T * Singleton(const char * globalName, std::function itkNotUsed(func), std::function deleteFunc) { return Singleton(globalName, std::move(deleteFunc)); }