Skip to content

refactor: drop direct dependency on Boost.SmartPtr#537

Merged
Becheler merged 1 commit into
boostorg:developfrom
Becheler:refactor/modernize-internal-smart-ptr
Jul 21, 2026
Merged

refactor: drop direct dependency on Boost.SmartPtr#537
Becheler merged 1 commit into
boostorg:developfrom
Becheler:refactor/modernize-internal-smart-ptr

Conversation

@Becheler

@Becheler Becheler commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

General hygiene related to Boost.SmartPtr

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

  • Remove dead includes
  • Refactor smart pointers from Boost to STL
  • Removed the dead r_c_shortest_paths_label base boost::enable_shared_from_this. shared_from_this() was never called.
  • Deleted 4 free comparison operators for shared_ptr<label> that dereferenced the pointer to sort (by label). With std::shared_ptr those would compete with STL comparison (by pointer).
  • Replaced them with comparators dereferencing the pointer: a small splabel_greater functor for the priority_queue, and a lambda for list::sort.

Motivation

Boost.SmartPtr does not have heavy dependencies (config, assert, throw_excpetion and core), but dead includes and C++14 STL is proper hygiene: https://github.com/cppalliance/cppalliance.github.io

Testing

Unchanged tests in CI

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 21, 2026
@Becheler Becheler added the technical debt Code that works but needs refactoring, cleanup, or modernization. Not user-facing. label Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 29821847603 vs develop run 29738450065 (ca4c9dfed1).

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

Dependency develop PR Δ
smart_ptr 17 0 -17

Transitive Boost modules: 68 → 68 (0)

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 29821847581 vs develop run 29738450095 (ca4c9dfed1).

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/modernize-internal-smart-ptr branch 3 times, most recently from 41463af to 3c92750 Compare July 21, 2026 05:45
@Becheler Becheler changed the title refactor: remove dead includes and modernize smart ptrs to STL where … refactor: drop dependencies to Boost.SmartPtr Jul 21, 2026
@Becheler
Becheler force-pushed the refactor/modernize-internal-smart-ptr branch from 3c92750 to 4787113 Compare July 21, 2026 06:17
@Becheler
Becheler marked this pull request as ready for review July 21, 2026 06:50
@Becheler
Becheler requested a review from jeremy-murphy as a code owner July 21, 2026 06:50
@Becheler Becheler changed the title refactor: drop dependencies to Boost.SmartPtr refactor: drop dependency on Boost.SmartPtr Jul 21, 2026
@Becheler Becheler changed the title refactor: drop dependency on Boost.SmartPtr refactor: drop direct dependency on Boost.SmartPtr Jul 21, 2026

@jeremy-murphy jeremy-murphy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor request, so I'm approving now.

Comment thread include/boost/graph/r_c_shortest_paths.hpp Outdated
@Becheler
Becheler force-pushed the refactor/modernize-internal-smart-ptr branch from 4787113 to ca4c9df Compare July 21, 2026 10:20
@Becheler
Becheler merged commit 70dd414 into boostorg:develop Jul 21, 2026
28 checks passed
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.

2 participants