Skip to content

Wide pointer narrowing tutorial using inheritance - #466

Merged
jbcoe merged 1 commit into
mainfrom
wide-pointer-narrowing
Oct 10, 2026
Merged

jbcoe merged 1 commit into
mainfrom
wide-pointer-narrowing

Conversation

@jbcoe

@jbcoe jbcoe commented Oct 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.54%. Comparing base (aefb701) to head (9d40e23).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #466   +/-   ##
=======================================
  Coverage   93.54%   93.54%           
=======================================
  Files          11       11           
  Lines         836      836           
  Branches       41       41           
=======================================
  Hits          782      782           
  Misses         26       26           
  Partials       28       28           
Flag Coverage Δ
consteval 90.15% <ø> (ø)
runtime 95.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@jbcoe
jbcoe force-pushed the jbcoe-wide-pointer-sbo branch 13 times, most recently from 42f8db5 to bb531ae Compare October 10, 2026 08:12
@jbcoe
jbcoe force-pushed the wide-pointer-narrowing branch 7 times, most recently from aab0990 to 419f215 Compare October 10, 2026 09:57
@jbcoe
jbcoe force-pushed the jbcoe-wide-pointer-sbo branch 2 times, most recently from 209e4e7 to b71fe3c Compare October 10, 2026 10:00
@jbcoe
jbcoe force-pushed the wide-pointer-narrowing branch from 419f215 to 4ecaad5 Compare October 10, 2026 10:06
@jbcoe
jbcoe marked this pull request as ready for review October 10, 2026 10:09
@jbcoe
jbcoe requested a review from philipcraig October 10, 2026 10:09

@philipcraig philipcraig 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.

Nice small demonstration of narrowing through vtable inheritance. The main point is the unconstrained T* constructors, which accept &wptr and bring back the nested call the tutorial is about. The rest are clarity suggestions.

Comment thread tutorials/08_wide_pointer_narrowing.cc Outdated
Comment thread tutorials/08_wide_pointer_narrowing.cc Outdated
Comment thread tutorials/08_wide_pointer_narrowing.cc Outdated
Comment thread tutorials/08_wide_pointer_narrowing.cc Outdated
Comment thread tutorials/08_wide_pointer_narrowing.cc Outdated
Comment thread tutorials/08_wide_pointer_narrowing.cc
Comment thread tutorials/08_wide_pointer_narrowing.cc
@jbcoe
jbcoe force-pushed the wide-pointer-narrowing branch 2 times, most recently from c2481f8 to fd07ed3 Compare October 10, 2026 17:17
@jbcoe
jbcoe requested a review from philipcraig October 10, 2026 19:09
Base automatically changed from jbcoe-wide-pointer-sbo to main October 10, 2026 19:22
FOLD

Build the wide pointer narrowing tutorial with CMake and rename its Bazel target

Use Vtable capitalisation in the narrowing tutorial

Fix clang-tidy findings in the narrowing tutorial

Lower-case wide vtable in the narrowing tutorial comment

Name the narrowing tutorial's thunk parameter self

Narrow wide pointers with conversion operators on WidePtr
@jbcoe
jbcoe force-pushed the wide-pointer-narrowing branch from fd07ed3 to 9d40e23 Compare October 10, 2026 19:24

@philipcraig philipcraig 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.

LGTM

@jbcoe
jbcoe merged commit e9b02f5 into main Oct 10, 2026
24 checks passed
@jbcoe
jbcoe deleted the wide-pointer-narrowing branch October 10, 2026 19:48
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