Skip to content

Removing many dependencies to Boost.MPL#527

Open
Becheler wants to merge 2 commits into
boostorg:developfrom
Becheler:refactor/mpl-to-mp11
Open

Removing many dependencies to Boost.MPL#527
Becheler wants to merge 2 commits into
boostorg:developfrom
Becheler:refactor/mpl-to-mp11

Conversation

@Becheler

@Becheler Becheler commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Reducing dependencies deadweights.

Before submitting

  • This PR targets the develop branch.
  • I searched for an existing PR or issue covering the same change.
  • My contribution is licensed under the Boost Software License 1.0.

Type of change

  • Bug fix
  • New feature or API addition
  • Refactor (no behavior change)
  • Documentation
  • Build, CI, or tooling
  • Other (specify below)

Does this PR introduce a breaking change?

  • Yes (describe migration impact below)
  • No

What this PR does

Migrates Boost.Graph's internal metaprogramming from Boost.MPL to the standard <type_traits>.

  • Removed dead boost/mpl includes (included but unused)

    • or.hpp in subgraph, void.hpp in graph_traits, print.hpp + if.hpp in CSR
    • if.hpp in directed_graph / undirected_graph / random_layout / detail/indexed_properties /detail/compressed_sparse_row_struct / graph_mutability_traits
    • bool.hpp in graphml / planar_detail/face_iterators
    • and.hpp + not.hpp in properties
  • Converted internal metafunctions off MPL (resolved type identical)

    • mpl::if_<C,A,B>::type to std::conditional<C::value,A,B>::type : adjacency_matrix, subgraph, properties, plod_generator, random, edge_list, labeled_graph, adjacency_list, detail/adjacency_list
    • mpl::if_c<…> to std::conditional<…> : betweenness_centrality, property_iter_range
    • mpl::and_<A, mpl::not_<B>>::type to std::integral_constant<bool, A::value && !B::value> : adjacency_list, detail/adjacency_list
    • mpl::not_<is_same<X,void>>::value to !is_same<X,void>::value : graph_concepts
    • mpl::eval_if<C,F1,F2>::type to std::conditional<C::value,F1,F2>::type::type (lazy branch instantiation preserved) : labeled_graph
    • mpl::bool_<B> to std::integral_constant<bool,B> : labeled_graph (is_default)
    • mpl::int_<N> to std::integral_constant<int,N> : internal tag dispatch in vf2_sub_graph_iso
    • internal true_/false_ dispatch tags to std::true_type/std::false_type : visitors, edge_list (is_random), adjacency_matrix, detail/is_distributed_selector
    • boost/mpl/*.hpp to <type_traits>

Motivation

MPL is an old dependency with long build times. It has been superseded by modern C++ standards and MP11.
This refactor switches to std and where possible.

Testing

Checklist

  • Existing tests pass (b2 in the test/ directory).
  • New behavior is covered by a test, or this is a docs / build / refactor change.
  • Documentation was updated if user-facing behavior changed.
  • No new compiler warnings on the platforms I built against.

@Becheler Becheler self-assigned this Jul 16, 2026
@Becheler Becheler added the technical debt Code that works but needs refactoring, cleanup, or modernization. Not user-facing. label Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 29508019477 vs develop run 29503421582 (e7fd958338).

Header-inclusion weights (graph files pulling each direct dependency in):

Dependency develop PR Δ
mpl 30 9 -21

Transitive Boost modules: 69 → 69 (0)

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 29508018791 vs develop run 29503421610 (e7fd958338).

Job Baseline After Delta
macos (clang, 14) 4 4 0
macos (clang, 17) 4 4 0
macos (clang, 20) 4 4 0
ubuntu (clang-19, 14) 4 4 0
ubuntu (clang-19, 17) 4 4 0
ubuntu (clang-19, 20) 4 4 0
ubuntu (clang-19, 23) 4 4 0
ubuntu (gcc-14, 14) 10 10 0
ubuntu (gcc-14, 17) 10 10 0
ubuntu (gcc-14, 20) 10 10 0
ubuntu (gcc-14, 23) 10 10 0
windows_msvc_14_3 (msvc-14.3) 971 971 0

@Becheler
Becheler force-pushed the refactor/mpl-to-mp11 branch 3 times, most recently from 7155fe7 to d54f6c5 Compare July 16, 2026 08:11
@Becheler
Becheler marked this pull request as ready for review July 16, 2026 10:13
@Becheler
Becheler requested a review from jeremy-murphy as a code owner July 16, 2026 10:13
@Becheler Becheler changed the title Removing dependency to Boost.MPL Removing many dependencies to Boost.MPL Jul 16, 2026
@Becheler
Becheler force-pushed the refactor/mpl-to-mp11 branch from d54f6c5 to e7fd958 Compare July 16, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical debt Code that works but needs refactoring, cleanup, or modernization. Not user-facing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant