ShapedNeighborhoodIterator<>::ConstIterator': is not a legal base class?

I am trying to build a Slicer CLI with C++20 settings, and I am running into:

M:\a\Sd\ITK\Modules\Core\Common\include\itkShapedNeighborhoodIterator.h(182,28): error C2516: 'slicer_itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator': is not a legal base class

The error persists even after I remove #include "itkShapedNeighborhoodIterator.h". The program builds fine outside of Slicer (with vanilla ITK and C++20). Did anyone encounter anything similar?

1 Like

I did not get to the bottom of this error. Instead I decided to update ITK version within Slicer. My draft PR is here:

I have encountered the same problem and don’t know how to solve it. Have you solved it now?
this error:
error C2516: “itk::ShapedNeighborhoodIterator<TImage,TBoundaryCondition>::ConstIterator”: The error persists Demo D:\ITK\ITK_debug\include\ITK-5.3\itkShapedNeighborhoodIterator.h 182

I have not solved it. I did not even narrow it down to as what causes it.

I am trying to compile version 5.1rc03 to see if the same issue occurs, and I look forward to your reply.