Very simple question. Is this valid C ++ 11?
struct Foo { int bar = 1; int baz = bar; };
GCC (4.7.2) and Clang (3.1) accept it with pedantic settings:
-std = c ++ 11 -Wall -W -pedantic
Intel C ++ (13.0.1.117) does not. He barks at int baz = bar; via:
error: a nonstatic member reference must be relative to a specific object
Who is right?
If you are wondering, I use this for code like this, where it brings the initialization code closer, rather than moving the last line to the constructor:
uint8_t colorR = -1; uint8_t colorG = -1; uint8_t colorB = -1; uint8_t colorA = -1; GLubyte RGBAVec[4] = {colorR, colorG, colorB, colorA};
source share