[osg-users] Change to Optimizer OptimizationOptions
pmartz at skew-matrix.com
Wed Nov 4 07:15:57 PST 2009
Peter Hrenka wrote:
> Has anybody had a look at Qt's QFlags?
> They provide a type-safe way of dealing with bit-mask-style enums.
> The implementation is mostly a template class with overloaded
> operators. Once you have the idea, it should be rather trivial
> to reimplement this from scratch and tailor it OSG's requirements.
Wow, that's really interesting. I never imagined there were so many
bitflag/mask patterns available.
But I imagine you guys already know how I feel about this. :-)
Personally, I already feel that using an enum to store bitflags is
overkill. Defining an entire class to implement the bitflag/mask pattern
along with set/get methods strikes me as the epitome of C++ abuse. I
don't think I can back this, not even if measurements indicate no memory
or performance bloat. It's an unnecessary layer of obfuscation.
Using bitwise logic ops and unsigned bits/masks makes it perfectly clear
what is happening, even at the assembly level. It reduces the potential
for error and makes the code more readable. It works great in this
simple form. It's not broke, and does not need to be fixed with a new
But I'm content to let Robert make the final call on this one. Clearly,
we can't agree on a path forward ourselves. Further discussion is
pointless; we should wait until he wraps up GL ES 2 and has time to
respond to this issue.
More information about the osg-users