Skip to content

core: rename has_vptr_fn to has_adl_vptr - #131

Merged
jll63 merged 1 commit into
boostorg:developfrom
jll63:fix/has-adl-vptr
Oct 18, 2026
Merged

jll63 merged 1 commit into
boostorg:developfrom
jll63:fix/has-adl-vptr

Conversation

@jll63

@jll63 jll63 commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

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

Renames detail::has_vptr_fn to detail::has_adl_vptr. No behaviour change.

core.hpp has two traits next to each other that look like duplicates, and are not:

has_adl_vptr<Class, Registry> (was has_vptr_fn) has_vptr<Traits, Arg>
detects boost_openmethod_vptr(const Class&, Registry*), found by ADL a static member Traits::vptr(arg) of virtual_traits
provided by the class: inplace_vptr_base, or the openmethod_vptr type-erasure concept the parameter's traits: std::any, boost::any, type_erasure::any, virtual_any
yields the v-table pointer, by value a reference to one

Each covers types the other cannot: std::any lives in namespace std, where no ADL overload can be added. And acquire_vptr treats them in opposite ways, rejecting the hook and using the traits member, because a by-value pointer cannot be stored by an indirect registry.

The old name read as "has a vptr function", which describes both. The adl_ prefix follows adl_affinity, the library's other ADL customization point. Neither trait had a comment; both now say what they detect.

Ordering with #127: that PR adds a use of the old name in init_bad_call. A textual merge of the two is clean, but the result would not compile, and GitHub would not notice. feature/dll therefore merges this branch and renames its own use, so the two PRs can land in either order.

Verified locally: CMake with clang-22, 198/198; b2 with gcc (-Wextra -Werror), 128 passed, no warnings.

🤖 Generated with Claude Code

The trait tells whether boost_openmethod_vptr, the customization point found
by ADL, applies to a class. Its name read like a general "has a vptr
function" test, which describes just as well the has_vptr that
BOOST_OPENMETHOD_DETAIL_HAS_STATIC_FN generates next to it - a different
extension point: a static member of virtual_traits, provided by the
parameter's traits rather than by the class, for types that cannot carry an
ADL overload of their own, such as std::any. The adl_ prefix follows
adl_affinity, the library's other ADL customization point.

Neither trait had a comment; both now say what they detect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jll63 added a commit to jll63/openmethod that referenced this pull request Oct 17, 2026
Brings develop up to the interop fix (boostorg#130) and the has_vptr_fn rename
(boostorg#131), so this branch builds on its own with the new name, and the two PRs
can land in either order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jll63 added a commit to jll63/openmethod that referenced this pull request Oct 17, 2026
The rename merged from fix/has-adl-vptr (boostorg#131) could not reach the one use
this branch adds in init_bad_call: the merge is clean as text, and would not
have compiled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cppalliance-bot

Copy link
Copy Markdown

An automated preview of the documentation is available at https://131.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-17 15:37:40 UTC

@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.34%. Comparing base (1137590) to head (5356efb).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #131   +/-   ##
========================================
  Coverage    92.34%   92.34%           
========================================
  Files           27       27           
  Lines         2234     2234           
  Branches       677      677           
========================================
  Hits          2063     2063           
  Misses         112      112           
  Partials        59       59           
Files with missing lines Coverage Δ
include/boost/openmethod/core.hpp 91.80% <ø> (ø)

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 1137590...5356efb. 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 5356efb into boostorg:develop Oct 18, 2026
55 of 56 checks passed
@jll63
jll63 deleted the fix/has-adl-vptr branch October 18, 2026 13:30
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