On Fri, 2011-09-02 at 11:03 -0500, Gabriel Beddingfield wrote:
You may be able to get away with it depending on your compiler
implementation/system/phase of the moon, but since in this particular
example you're just dispatching by type anyway and gaining nothing from
using inheritance, it'd be a bit silly to do so...
This may be a hand-wavey justification, but I have seen some pretty
weird stuff happen when I treated not-strictly but pretty-much-POD
objects as POD data. Weird stuff like things working fine 99% of the
time but catastrophically exploding occasionally. Given that this is
explicitly illegal (i.e. that you don't do this is an assumption the
compiler makes), and aggressive optimization is in use, this isn't too
surprising. It's best not to tread in that dark valley, C++ is awful
enough when you follow the rules :)
-dr
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.