Deprecate Unused, use C++17 [[maybe_unused]] instead#4266
Conversation
Removed `Unused(singletonIndex)` calls. Instead, added `[[maybe_unused]]` to `singletonIndex` variable declarations.
| { | ||
| // static SingletonIndex * singletonIndex = SingletonIndex::GetInstance(); | ||
| // Unused(singletonIndex); | ||
| // [[maybe_unused]] static SingletonIndex * singletonIndex = SingletonIndex::GetInstance(); |
There was a problem hiding this comment.
This commented-out declaration of singletonIndex was introduced with pull request #118 commit a66337e "ENH: Synchronize factories across modules in Python", Francois Budin (@fbudin69500), February 2019:
ITK/Modules/Core/Common/src/itkObjectFactoryBase.cxx
Lines 925 to 926 in a66337e
Maybe we might as well just remove those two commented-out lines of code. It's very hard to keep commented-out code up-to-date. What do you think?
There was a problem hiding this comment.
Since you already did the work, perhaps let's keep it this time. But yes, we can occasionally clean up commented-out code.
ITK itself does not call `Unused` anymore.
b724650 to
a24573a
Compare
| { | ||
| // static SingletonIndex * singletonIndex = SingletonIndex::GetInstance(); | ||
| // Unused(singletonIndex); | ||
| // [[maybe_unused]] static SingletonIndex * singletonIndex = SingletonIndex::GetInstance(); |
There was a problem hiding this comment.
Since you already did the work, perhaps let's keep it this time. But yes, we can occasionally clean up commented-out code.
|
/azp run ITK.Windows |
Two style commits:
Unusedcalls with C++17[[maybe_unused]]attributeUnused(const T &)