Hi Paul,

Can someone please explain the MixinVector change and why it was necessary? Also, please explain the name "MixinVector" -- what, exactly, is a "Mixin"? If this is a design pattern, I must admit I'm not familiar with it.

To add to what Robert said:

http://en.wikipedia.org/wiki/Mixin

"In object-oriented programming languages, a mixin is a class that provides a certain functionality to be inherited by a subclass, but is not meant to stand alone. Inheriting from a mixin is not a form of specialization but is rather a means to collect functionality. A class may inherit most or all of its functionality by inheriting from one or more mixins through multiple inheritance."

In effect, since MixinVector has a std::vector, and has operations that just redirect calls to the internal std::vector (like operator[], push_back() etc.), and then the Array classes inherit from MixinVector instead of directly from std::vector, the functionality is the same, but it removes the problem that was caused by std::vector's destructor not being virtual.

It's debatable whether std::vector was just not meant to be subclassed or whether it was an oversight when designing it... The previous use would certainly have been valid if the destructor had been declared virtual.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [EMAIL PROTECTED]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to