C++0x 10
■ このスレッドは過去ログ倉庫に格納されています
0640デフォルトの名無しさん
2010/09/11(土) 01:21:27つまり、これが C++0x なら通るのか?って話だね。
#include <cassert>
struct Boo
{
Boo() : b(111) {}
int b;
};
struct Foo
{
Boo boo;
int f;
};
Foo foo[100] = {0};
int main()
{
for (int i = 0; i < 100; ++i)
{
assert(foo[i].f == 0);
assert(foo[i].boo.b == 111);
}
return 0;
}
cygwin の g++ 4.3 だと、まだ initializer list の対応が入ってなくて試せない。
■ このスレッドは過去ログ倉庫に格納されています