tags:

views:

131

answers:

1

If I have something like this:

MyStruct clip;

clip = {16, 16, 16, 16};

I get the following warning from the compiler: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x

If I active -std=c++0x in the compiler, it does not give any warning. But I'm not sure if I am following the standard. So should I deactivate that flag and initialize each member of the structure separately?

Thank you.

+8  A: 

For initialization you should be able to use MyStruct clip = {16, 16, 16, 16}; but as you discovered in the current C++ standard you can't assign to a bracketed list. In C++1x you can use the extended syntax.

Mark B
Well oks, I should have read some info about this new standard http://en.wikipedia.org/wiki/C%2B%2B0x sorry xDAnyway, thank you!!
Puyover