#include <iostream>
using namespace std;
struct test
{
int factorX;
double coefficient;
};
int main()
{
test firstTest = {1, 7.5}; //that's ok
test *secondTest = new test;
*secondTest = {8, 55.2}; // issue a compiler warning
}
I don't understand why the compiler issues the following warning:
test2.cpp:13:33: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
test2.cpp:13:33: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
I know that in C++11 I can omit the assignment operator but that's not the case. I am using g++ 4.7.2.