Replace BOOST_FOREACH with range-based for in example/graph-thingie.cpp - #607
Conversation
|
Boost dependency footprint vs Header-inclusion weights (graph files pulling each direct dependency in): No header-inclusion-weight changes. Transitive Boost modules: 47 → 47 (0) |
|
Compiler-warning counts vs
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
example/graph-thingie.cpp
51c2540 to
192743b
Compare
|
Thanks again @reach2sayan ! One minor remark is to reduce the verbosity of such future PRs. The git diff is very small/straightforward but the PR description makes it look like a serious change where reviewers must pay attention and read all the PR description :) AI is pretty verbose and loves to generate text, so finding the right level of verbosity can be tricky! Thanks again! |
This is funny. This was the one bit that was totally me :p (painstakingly marking the x's) 😂. I thought that was a bgl standard. I was getting tired of that NGL 😂 |
|
Ahaha we do scan the crossed boxes ! It helps knowing what the expectations are (if there is a behavior change when the x shows refactor, then we can assume it's a mistake and flag it). I was mostly speaking about this part, that can be much lighter as CI and bots will show us the required information!
For short PRs, the "change summary" section may end up more verbose than the actual file diff, so no worries we will be happy with a "refactor BOOST_FOREACH in file xxx" 🤗 It's useful for more complex PRs with many changes when reviewers may need a high level vision on how the changes are related and why 🙃 or to show local benchmarks results |
Before submitting
developbranch.Type of change
Does this PR introduce a breaking change?
What this PR does
Replaces the single
BOOST_FOREACHloop inexample/graph-thingie.cpp(oververtices(graph)) with range-basedfor.vertices()returns astd::pairof iterators, so the range is wrapped inboost::make_iterator_range(...).#include <boost/foreach.hpp>becomes#include <boost/range/iterator_range.hpp>.The loop variable keeps its explicit type (
graph_t::vertex_descriptor) and the loop body is unchanged. Example only; no library code is touched.Motivation
Refs #593 (task 1.3, "
BOOST_FOREACHto range-basedfor"), itemexample/graph-thingie.cpp. Same approach as #603 and #604.Testing
b2 graph-thingie,b2 cxxstd=20 graph-thingie(gcc 13) andb2 toolset=clang cxxstd=17 graph-thingie(clang 18) fromlibs/graph/exampleon Linux: allpassed.
-Wall -Wextraat C++14/17/20/23 on gcc 13 and clang 18:zero warnings.
developversion at every standardon both compilers, including the
vertex a (NODE_A)/vertex b (NODE_B)/vertex c ()lines printed by the converted loop.Checklist
b2in thetest/directory).