I created a new Xcode project by selecting "external build system" and set the build tool to /usr/bin/g++
(which is what I used when compiling from the terminal). Now I am trying to initialize a 2d vector of doubles using an initializer list, but get the error:
Non-aggregate type 'vector<vector<double>>' cannot be initialized with an initializer list
This is the code I am trying to compile:
vector< vector < double > > dct_mat =
{
{0.3536, 0.3536, 0.3536, 0.3536, 0.3536, 0.3536, 0.3536, 0.3536},
{0.4904, 0.4157, 0.2778, 0.0975, -0.0975, -0.2778, -0.4157, -0.4904},
{0.4619, 0.1913, -0.1913, -0.4619, -0.4619, -0.1913, 0.1913 , 0.4619},
{0.4157, -0.0975, -0.4904, -0.2778, 0.2778, 0.4904, 0.0975, -0.4157},
{0.3536, -0.3536, -0.3536, 0.3536, 0.3536, -0.3536, -0.3536, 0.3536},
{0.2778, -0.4904, 0.0975, 0.4157, -0.4157, -0.0975, 0.4904, -0.2778},
{0.1913, -0.4619, 0.4619, -0.1913, -0.1913, 0.4619, -0.4619, 0.1913},
{0.0975, -0.2778, 0.4157, -0.4904, 0.4904, -0.4157, 0.2778 ,-0.0975}
};
How can I enable initializer lists? I don't care if I need to change my g++ for something else. I just don't know what compiler should I use. If you know which compiler will work for me, please also state how to tell Xcode to use it.