refactor: drop Boost.Algorithm - #590
Conversation
037a616 to
b40801d
Compare
|
Boost dependency footprint vs Header-inclusion weights (graph files pulling each direct dependency in):
Transitive Boost modules: 49 → 47 (-2)
|
|
Compiler-warning counts vs
|
269f9c8 to
f873e39
Compare
f873e39 to
ca7d38d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
| edge_descriptor e | ||
| = *boost::first_max_element(edges_iters.first, edges_iters.second, cmp); | ||
| auto max_edge_it = edges_iters.first; | ||
| for (auto edge_it = edges_iters.first; edge_it != edges_iters.second; ++edge_it) | ||
| if (cmp(*max_edge_it, *edge_it)) | ||
| max_edge_it = edge_it; | ||
| edge_descriptor e = *max_edge_it; |
There was a problem hiding this comment.
std::max_element - cppreference.com https://share.google/cBYeq3gW04DAipAiH
?
There was a problem hiding this comment.
That was my first try but it fails compilation because of a conflict between requirements of boost versus stl iterators (ForwardIterator).
There was a problem hiding this comment.
Ehhh, I see, thanks.
Before submitting
developbranch.Type of change
Does this PR introduce a breaking change?
What this PR does
topology.hpp: replacedalgorithm/minmax.hppinclude with<algorithm>howard_cycle_ratio.hppandbc_clustering.hpp: replacedboost::first_max_elementwith an explicit first-max loopgraphviz.hpp: replacedboost::algorithm::replace_allwith a quote-escape loopread_graphviz_new.cpp: replacedboost::algorithm::to_lower_copywithstd::transformparallel_edges_loops_test.cppandall_planar_input_files_test.cpp: replacedboost::splitwith a looptest/bc_clustering_test.cpp: guards the max-edge pick (bridge removed, graph splits into 2 components)std::max_elementis not usable here: it requires a ForwardIterator, and libc++ enforces that with a hard static_assert, but BGL's edge iterators declare a category that does not satisfy it.boost::first_max_elementhad no such check, so the replacement is a short explicit loop instead.Motivation
Boost.Algorithm adds 30 dependencies for something that STL and short loops can do easily.
Testing
Checklist
b2in thetest/directory).