core
core copied to clipboard
Replace deprecated `std::iterator`
std::iterator is set to be deprecated in C++17. See more explanations here. Its usage should be replaced to ensure compatibility with newer C++ standards.
@Sichao25 Thank you. This was found when building with C++20?
Yes. The related usage is pumi/pumi_list.h.
If we're making changes to support later C++ standards, I would like to see APF_ITERATE deprecated. If there are internal uses they should probably be range-based for loops.
I played around with the idea of proper iterator support for PUMI meshes a long time ago. There is one subtle point that makes that tricky. The range-based for loops rely on begin and end. However, for a mesh, we may want to loop over all dimensions, or just a single dimension. I'm sure there is some interface that makes sense and can support that I just am not 100% sure what it looks like.
I'm talking specifically about the STL iteration helpers in apf.h: https://github.com/SCOREC/core/blob/17ad033da30c8079a69e8142486ce01892c562b8/apf/apf.h#L634-L649
@bobpaw is there a strong reason to replace these? It seems like it will be more effort than it's worth to remove it.
Nope, just a wish-list item.
closed with https://github.com/SCOREC/core/pull/482