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

make the library fully usable without RTTI #293

Open
robUx4 opened this issue Mar 4, 2024 · 0 comments
Open

make the library fully usable without RTTI #293

robUx4 opened this issue Mar 4, 2024 · 0 comments

Comments

@robUx4
Copy link
Contributor

robUx4 commented Mar 4, 2024

RTTI (Runtime Type Idenfitication) used with dynamic_cast<> allows casting do a type or to nullptr if the type doesn't match. It is a very useful feature. But it's also a costly feature at runtime. It's also potentially introduces nullptr in places where it shouldn't be. So it should be avoided whenever possible. In some environment it's even turned off.

mkvtoolnix uses it a lot and even mkvtree needs it to differentiate between base EBML types to display. It can be partly avoided by adding the EBML type inside the EbmlCallbacks (aka element spec). All EBML elements have a type defined in the EBML RFC. It can be used as an enum to initialize each EbmlCallbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant