No compiler error when mistyping gl::ScopedX lines can be very confusing

For example I often type

gl::ScopedBlend( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );

instead of

gl::ScopedBlend blendScope( GL_ONE, GL_ONE_MINUS_SRC_ALPHA );

The compiler will not give me any hint that I did something wrong, but the method will just have no effect. When debugging complex drawing code this can cause a lot of headaches before finally figuring out that the issue was a typo…

Just a heads up, perhaps there is a way to fix this…

1 Like