On 27 February 2018 at 22:22, Matthew Brincke <[email protected]> wrote:
> I'd like
> to make its code more C++-like by removing those
> and replacing them with dynamic_cast.

My opinion: dynamic_cast has a runtime performance cost and should be
done when it is desired to test the type hierarchy at runtime, for
example when doing conditional code based on types. Most of the time,
C/C++ developer are perfectly aware of the safeness of the casts they
are doing, and they do C style casts or C++ static casts, getting a
performance advantage over doing dynamic_cast everywhere. Since C/C++
are languages where developers are supposed to be more aware of the
consequences of their choices, I would rather prefer keeping C/C++
static casts instead of blindly convert of all them to dynamic_cast.
There are a lot of other places where I would invest time in improving
the code, such as 32/64 bits API determinism (this was discussed
today) or optimizations (removing double lookups from dictionaries).

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to