Skip to content

Remove redundant dynamic_casts. - #21

Merged
jmcarcell merged 1 commit into
iLCSoft:masterfrom
scott-snyder:dyncast-20250313
Jul 21, 2026
Merged

Remove redundant dynamic_casts.#21
jmcarcell merged 1 commit into
iLCSoft:masterfrom
scott-snyder:dyncast-20250313

Conversation

@scott-snyder

Copy link
Copy Markdown
Contributor

Also get an exception if the cast fails, rather than a null pointer dereference.

BEGINRELEASENOTES

  • Remove redundant uses of dynamic_cast.
    ENDRELEASENOTES

Also get an exception if the cast fails, rather than a null pointer dereference.
@jmcarcell
jmcarcell merged commit d300f96 into iLCSoft:master Jul 21, 2026
4 of 5 checks passed
@jmcarcell

Copy link
Copy Markdown
Contributor

Note that this changes the behaviour in case of nullptr since dynamic casting to a reference will throw std::bad_cast. We'll see tomorrow if this has any impact.

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