Skip to content

ES.49: Simplify named casts example#2329

Open
brett-m-rogers wants to merge 1 commit into
isocpp:masterfrom
brett-m-rogers:upcast_simplify
Open

ES.49: Simplify named casts example#2329
brett-m-rogers wants to merge 1 commit into
isocpp:masterfrom
brett-m-rogers:upcast_simplify

Conversation

@brett-m-rogers

@brett-m-rogers brett-m-rogers commented Jun 11, 2026

Copy link
Copy Markdown

The use of a template function, whose typename D shadows the class D defined above, obscures the apparent intention of ES.49's example, which is to show how named casts can help prevent bugs that arise when two types are mistakenly assumed to be related.

Furthermore, the use of 'upcast' for the function name appears to be a typo; the example casts intend to show downcasts.

@brett-m-rogers

brett-m-rogers commented Jun 15, 2026

Copy link
Copy Markdown
Author

@cubbimew I can fix the whitespace issue that's breaking CI here too, if you're happy for the changes to be combined. I just saw you're working on it.

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.

1 participant