Very simple question. Is this valid C++11?
struct Foo {
int bar = 1;
int baz = bar;
};
GCC (4.7.2) and Clang (3.1) both accept it with the pedantic settings:
-std=c++11 -Wall -W -pedantic
Intel C++ (13.0.1.117) does not. It barks at int baz = bar;
with:
error: a nonstatic member reference must be relative to a specific object
Who is right?
In case you wonder, I use this for code like this, where it brings initialization code closer together, rather than moving the last line into 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};