Skip to content

Include what you use in headers, tests and examples - #135

Merged
jll63 merged 1 commit into
boostorg:developfrom
jll63:iwyu
Oct 19, 2026
Merged

jll63 merged 1 commit into
boostorg:developfrom
jll63:iwyu

Conversation

@jll63

@jll63 jll63 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

(Written by Claude Code, on behalf of @jll63.)

Include what you use.

  • Headers: add the standard and Boost headers each file names directly (<cstddef>, <type_traits>, <utility>, <algorithm>, <iterator>, boost/mp11/*, boost/config.hpp, boost/assert.hpp, ...) instead of relying on transitive includes; drop the includes nothing uses.
  • Tests, examples, snippets, ce/: only gain missing standard includes. Unused-include removal is not attempted there.

No code changes. The audit was a hand-rolled symbol scan (include-what-you-use is not installed), so a real IWYU run may find more.

Verified locally: CMake 218/218 (clang 22), reflection build 214/214 (g++ 16), b2 gcc, every header compiles standalone (clang, gcc, MSVC v18 /W4 /WX), clang-format 22 clean, docs rebuild.

🤖 Generated with Claude Code

https://claude.ai/code/session_016NKQZ2ktRZ1AjCgSLLeXma

Add the standard and Boost headers each file names directly instead of
relying on transitive includes, and drop the few includes nothing uses
(<algorithm> and <tuple> in core, <memory> and <string> in initialize,
<random> in ostdstream, <algorithm> in static_list, <variant> in
vptr_vector, <memory> in the intrusive_ptr interop).

Tests, examples, snippets and ce/ only gain missing standard includes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NKQZ2ktRZ1AjCgSLLeXma
@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://135.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-10-19 20:37:57 UTC

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.56%. Comparing base (93bb513) to head (b681217).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #135   +/-   ##
========================================
  Coverage    92.56%   92.56%           
========================================
  Files           29       29           
  Lines         2314     2314           
  Branches       699      699           
========================================
  Hits          2142     2142           
  Misses         111      111           
  Partials        61       61           
Files with missing lines Coverage Δ
include/boost/openmethod/core.hpp 92.18% <ø> (ø)
include/boost/openmethod/detail/ostdstream.hpp 96.77% <ø> (ø)
include/boost/openmethod/detail/static_list.hpp 100.00% <ø> (ø)
include/boost/openmethod/initialize.hpp 92.97% <ø> (ø)
include/boost/openmethod/inplace_vptr.hpp 100.00% <ø> (ø)
include/boost/openmethod/interop/boost_any.hpp 100.00% <ø> (ø)
...e/boost/openmethod/interop/boost_intrusive_ptr.hpp 94.44% <ø> (ø)
include/boost/openmethod/interop/std_any.hpp 100.00% <ø> (ø)
...nclude/boost/openmethod/interop/std_shared_ptr.hpp 94.73% <ø> (ø)
...nclude/boost/openmethod/interop/std_unique_ptr.hpp 90.00% <ø> (ø)
... and 11 more

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93bb513...b681217. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jll63
jll63 merged commit 954159a into boostorg:develop Oct 19, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants