#include
struct foo {
int i;
int j;
int k;
};
int main() {
std::vector v(1);
v[0] = {0, 0, 0};
return 0;
}
Pre C++11 (and possibly C99) you can only initialize a POD at creation, not at arbitrary runtime points, which is what you're attempting here (assignment from an initializer list).
You can make a null_foo though:
int main()
{
const foo null_foo = {0, 0, 0};
std::vector v(1);
v[0] = null_foo;
return 0;
}