Skip to content

[DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this - #96

Draft
jbcoe wants to merge 27 commits into
mainfrom
tutorials
Draft

[DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this#96
jbcoe wants to merge 27 commits into
mainfrom
tutorials

Conversation

@jbcoe

@jbcoe jbcoe commented Jul 22, 2026

Copy link
Copy Markdown
Owner

I'm not entirely sure that these tutorials are necessary.

The act of writing them was useful and perhaps they will be useful to readers of the (increasingly novel and technical) code in #95.

@jbcoe
jbcoe force-pushed the tutorials branch 2 times, most recently from 4d2bd17 to 321b94c Compare July 22, 2026 19:53
@jbcoe
jbcoe requested a review from Twon July 22, 2026 22:18
@jbcoe
jbcoe marked this pull request as ready for review July 22, 2026 22:18
@Twon

Twon commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

I think these are great, first 2 down and working through the 3rd now, but these are definitely useful (I'm learning reflection from the 3rd).

Perhaps the files could be renamed with a number indicating the order of the tutorials?

  1. 1_type_erasure.cc
  2. 2_vanishing_this_pointer
  3. 3_reflection.cc

The pedant in me finds it odd to start in the middle, go down and then go up in the file view in VSCode.

Comment thread tutorials/3_reflection.cc
Comment thread tutorials/3_reflection.cc
@jbcoe
jbcoe requested review from RyanJK5 and Twon July 23, 2026 09:54
Comment thread tutorials/2_vanishing_this_pointer.cc
Comment thread tutorials/3_reflection.cc
@jbcoe
jbcoe requested a review from RyanJK5 July 24, 2026 18:30

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

I just gave the tutorials an in-depth look, and I think they are very good! All of the information is accurate. I left some comments, mostly regarding additional pieces of the reflection tutorial worth acknowledging. Thanks for putting these together!

Comment thread tutorials/2_vanishing_this_pointer.cc
Comment thread tutorials/2_vanishing_this_pointer.cc
Comment thread tutorials/2_vanishing_this_pointer.cc Outdated
Comment thread tutorials/2_vanishing_this_pointer.cc Outdated
Comment thread tutorials/3_reflection.cc
Comment thread tutorials/3_reflection.cc Outdated
Comment thread tutorials/3_reflection.cc
Comment thread tutorials/3_reflection.cc
Comment thread tutorials/3_reflection.cc Outdated
Comment thread tutorials/3_reflection.cc
@jbcoe

jbcoe commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

@RyanJK5 thanks for the detailed review comments. This is exactly what’s needed for foundational material. Thanks for taking the time.

@jbcoe
jbcoe requested a review from RyanJK5 July 26, 2026 16:52

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

Looks good to me now, thanks for making those changes!

Comment thread tutorials/3_reflection.cc Outdated
@jbcoe
jbcoe requested a review from Twon July 28, 2026 20:23
Comment thread tutorials/3_reflection.cc Outdated
Comment thread tutorials/3_reflection.cc Outdated
Comment thread tutorials/3_reflection.cc
Comment thread tutorials/3_reflection.cc Outdated
Comment thread tutorials/3_reflection.cc
Comment thread tutorials/3_reflection.cc Outdated
…nto a signature-string example with a real multi-parameter case

- Prefer std::ranges::range auto / std::ranges::views::filter over raw
  loops where the tutorial's own facilities allow it.
- Section 5 was bundling two unequal helpers: a mostly-redundant
  find-by-name filter and the actually-new signature-string builder.
  Folded the name filter's only new content (is_const) into section 4,
  where it fits as a natural extension of the existing enumeration
  example, and narrowed section 5 to what's genuinely new: reading a
  member's parameters and rendering them as a signature string.
- Widget in section 5 now has a real multi-parameter overload
  (write(int, double)), so the comma-join logic in
  simple_signature_string is actually exercised by a test, not just
  present in the code.
@jbcoe
jbcoe requested a review from Twon August 6, 2026 00:27
@jbcoe
jbcoe marked this pull request as draft August 12, 2026 22:41
@jbcoe jbcoe changed the title Add tutorials for type-erasure, reflection and vanishing-this [DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this Aug 12, 2026
@jbcoe

jbcoe commented Aug 12, 2026

Copy link
Copy Markdown
Owner Author

I'm going to re-work these tutorials to make them more focused.

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.

3 participants