I would like to do the following:
class MyClass { public: MyClass() : arr({1,2,3,4,5,6,7,8}) {} private: uint32_t arr[8]; };
Works perfectly on GCC 4.5.2 with -std=gnu++0x. I get a warning and a freeze with -std=c++98.
Your syntax is correct. Alternatively, you can say arr{1,2,3,...}.
arr{1,2,3,...}
Most likely is that your compiler just doesn't support this construction yet. GCC 4.4.3 and 4.6.1 both do (with -std=c++0x).
-std=c++0x