fix: remove dependency to MPL in graph_traits using detector idiom#528
Merged
Becheler merged 1 commit intoJul 16, 2026
Merged
Conversation
|
Boost dependency footprint vs Header-inclusion weights (graph files pulling each direct dependency in): No header-inclusion-weight changes. Transitive Boost modules: 70 → 70 (0) |
Becheler
force-pushed
the
refactor/graph-traits-void-t-detector
branch
from
July 16, 2026 11:30
227c2d4 to
479ee6f
Compare
|
Compiler-warning counts vs
|
Becheler
marked this pull request as ready for review
July 16, 2026 13:14
jeremy-murphy
approved these changes
Jul 16, 2026
Collaborator
|
Looks good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reducing dependencies to MPL is important for compile time, dependency graph and general hygiene, as similar behavior is available with modern C++.
Before submitting
developbranch.Type of change
Does this PR introduce a breaking change?
What this PR does
graph_traitsreports a graph's associated types (vertex type, edge type...). Not every graph defines all of them, sograph_traitsneeds to check if a member type exists on the graph, use it if it does, and fall back tovoidif it doesn't.That check was built with Boost.MPL. It used
BOOST_MPL_HAS_XXX_TRAIT_DEFmacro to generate a "has member X" trait, thenmpl::eval_ifandmpl::identityto pick either the member or the fallback. This pulled in fiveboost/mplheaders just to answer "does this type have member X".This PR refactors it using standard C++
void_tdetector idiom. Two small template overloads do the check directly: one matches when the member type exists and exposes it, the other is the fallback. Same result, no MPL, no new dependency, behavior is unchanged.Motivation
Reducing dependencies to MPL is important for compile time, dependency graph and general hygiene, as similar behavior is available with modern C++.
Testing
Checklist
b2in thetest/directory).