Class template argument deduction (CTAD) for Image Iterators in Core/Common#5845
Draft
N-Dekker wants to merge 4 commits intoInsightSoftwareConsortium:mainfrom
Draft
Class template argument deduction (CTAD) for Image Iterators in Core/Common#5845N-Dekker wants to merge 4 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker wants to merge 4 commits intoInsightSoftwareConsortium:mainfrom
Conversation
Replaced `ImageType` with `TImage` as argument type of constructors of Image Iterators, in order to support class template argument deduction (CTAD). Following pull request InsightSoftwareConsortium#4013 commit 1b14a34 "STYLE: Use TImage for CTAD supporting constructors ImageScanlineIterator"
Added class template argument deduction guides to the Image Iterator class templates, in order to support passing a `SmartPointer` as constructor argument. Using Notepad++, Replace in Files, doing: Find: `(Image\w*ConstIterator\w*)(\(const TImage \* ptr, const RegionType & region\).+\r\n};)` Replace with: `$1$2\r\n\r\n// Deduction guide for class template argument deduction \(CTAD\).\r\ntemplate <typename TImage>\r\n$1\(SmartPointer<TImage>, const typename TImage::RegionType &\)\r\n -> $1<std::remove_const_t<TImage>>;\r\n` Find: `(Image\w*Iterator\w*)(\(TImage \* ptr, const RegionType & region\).+\r\n};)` Replace with: `$1$2\r\n\r\n// Deduction guide for class template argument deduction \(CTAD\).\r\ntemplate <typename TImage>\r\n$1\(SmartPointer<TImage>, const typename TImage::RegionType &\)\r\n -> $1<TImage>;\r\n` Filters: `itk*ConstIterator*.h` Directory: `D:\ITK\Modules\Core\Common\include` [v] Match case (*) Regular expression [v] . matches newline Excluded the Scanline iterators, as they already have an CTAD guide.
This GTest tests Image Iterators in general, not just `ImageRegionIterator`.
Checks that the iterator class templates in "Core/Common" support class template argument deduction (CTAD).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for class template argument deduction (CTAD) to all "traditional" ITK Image Iterators in "Core/Common". Added deduction guides that support argument deduction from a
SmartPointer(anImage::Pointeror anImage::ConstPointer).