Re: RTTI in CS
res <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Message-ID | <[email protected]> |
Uh, seems this went unanswered for a small while now... Is my answer still relevant or did the real-world usage prove dynamic_cast<>s generally work? ;p On 30.01.2013 14:36, Christian Van Brussel wrote: > any idea of the status of the use of Run-Time Type Information in CS? > > The physics2 plugin uses currently a lot dynamic casts, and there are > also some places here and there in CS where they are used, such as in > the csparser and the software sound renderer. > > Does all those dynamic casts need to be removed or is it OK now? A dynamic_cast<> for an object from the same module (i.e. plugin) to a type “defined“ in the same module should be fine. dynamic_cast<>s across modules have potential for problems. (dynamic_cast<> usually needs some extra data at runtime; but by casting ”across modules” you may end up with issues like the instance from module A might requiring some data not visible/available from module B. Or perhaps something is found in module B... which is is actually the wrong type information.) However, at least we used to disable RTTI in release builds... so I recommend you test it there. Depending on how extensively dynamic_cast<>s are used, it might be a good idea to look for some feature in a demo program that would certainly cause a code path using a dynamic_cast<> being utilized. If you can tell people to “start this app, press that key” we can more quickly test if we're in the clear. -Frank ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Crystal-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-develop
signature.asc
(application/pgp-signature, 263 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlE1IpYACgkQNCTzcE/07ewcawCfU3qzi8WIjgHJEcznlf+iPFJe etIAniraQSMfDMOxx2l4pydyXUUOmuxA =HzC0 -----END PGP SIGNATURE-----