Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all usage of dynamic_cast<> #39

Merged
merged 2 commits into from
May 27, 2020

Conversation

ptc-jhoerner
Copy link
Contributor

Hi,

This removes usage of dynamic_cast from the library.

As all the nodes already hold E57 type information, we don't need to rely on RTTI. dynamic_cast<> is much slower (especially on MSVC) than custom simple type checks as it must be much more generic. Moreover, there are already those checks in place so usage of dynamic_cast<> is redundant.

This also fixes a couple of warnings reported when compiling with Xcode.

I have formatted the changes with the new .clang-format style.

Cheers,
Jiri

image
Jiri Hörner
Software Development Engineer, Vuforia

jhoerner@ptc.com

vuforia.com


Parametric Technology Gesellschaft m.b.H., Operngasse 17-21, 1040 Wien, Austria. Firmensitz: Wien, FN: 111171 m, Firmenbuchgericht: Handelsgericht Wien.

The information contained in this email transmission is confidential and may be privileged. If you are not the intended recipient, any use, dissemination, distribution, publication, or copying of the information contained in this email is strictly prohibited. If you have received this email in error, please immediately notify me by calling the above number and delete the email from your system. Thank you for your co-operation.

Copyright © 2020 PTC Inc. and/or all its affiliates or subsidiaries. All rights reserved

All the nodes already hold E57 type information, so we don't need to rely on RTTI. dynamic_cast<> is much slower (especially on MSVC) than custom simple type checks as it must be much more generic. Moreover, we already have those checks in place so usage of dynamic_cast<> is redundant.
* implicit conversions
* unused variable
@asmaloney asmaloney merged commit 2ca5e8c into asmaloney:master May 27, 2020
@asmaloney
Copy link
Owner

Thank you for your contribution!

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.

None yet

2 participants