[Plug] Update TF_FOR_ALL to C++11 iterator
Description of Change(s)
Update files under pxr/base/plug by replacing TF_FOR_ALL with C++11-style range-based for each loop.
Additionally, updated pointer usage to align with the new iterator approach, since we now handle references directly rather than raw pointers.
There is C++17 possibility to be used in some cases but this is left for another discussion.
Obgoing Issue(s)
This PR addresses issue https://github.com/PixarAnimationStudios/OpenUSD/issues/80, though many more instances still need to be resolved. Given the age of this issue (approximately 6–7 years), I wanted to reopen the discussion to evaluate its relevance. Specifically, is the header iterator.h still necessary?
Previous attempts to address this issue (e.g., https://github.com/PixarAnimationStudios/OpenUSD/pull/396) have been closed without further updates to the thread. I look forward to hearing thoughts on whether we should proceed with this.
Checklist
-
[x] I have created this PR based on the dev branch
-
[x] I have followed the coding conventions
-
[ ] I have added unit tests that exercise this functionality (Reference: testing guidelines)
-
[x] I have verified that all unit tests pass with the proposed changes
-
[x] I have submitted a signed Contributor License Agreement (Reference: Contributor License Agreement instructions)
Specifically, is the header iterator.h still necessary?
The Tf_ProxyReferenceReverseIterator is required until OpenUSD migrates to C++20. I also think there's also not a great drop in replacement for TF_REVERSE_FOR_ALL without std::ranges::views::reverse.
Ranged for otherwise sounds great to me. I would recommend using const TYPE& (or const auto&) whenever possible.
Filed as internal issue #USD-10625
:heavy_exclamation_mark: Please make sure that a signed CLA has been submitted!
(This is an automated message. See here for more information.)
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).