Closed LethalGhost closed 9 years ago
Adding virtual destructors to classes is not a good idea unless they already have virtual functions or need to have a virtual table for dynamic casting purposes. There is an overhead to having a virtual table and it also changes an class/struct to no longer being a StandardLayoutType, and thus also not a POD.
This is a particular important requirement for our matrix+vector types as we use them for data exchange with the GPU and thus must have a stronger guarantee that for example sizeof(Vec4f) == 4 * sizeof(float).
Forgot to add the links to http://en.cppreference.com/w/cpp/concept/StandardLayoutType and http://en.cppreference.com/w/cpp/concept/PODType for further information.
Ok, got it. Fix this shortly. Is it OK if I ask you a few questions about ClanLib later?
Updated.
Feel free to ask questions either via github or #clanlib on irc.freenode.net (however the only active developers on there is currently myself and judas)
Replace assigning with member initialization. Add virtual destructors to basic classes. Replace c-style cast with cpp-style cast. Some minor style improvements.