If I want to initialize a vector inside a class, for example:
class A {
private:
static std::vector<double> label_map;
};
If I want to initialize this static vector, what is the best way to do? I’ve read in some other posts saying that starting from GCC 4.4, it supports new features in C++0x and we can directly use
static std::vector<double> label_map = {1, 2, 3, 4};
However seems it doesn’t work for me.
So… wrapping up:
Compile with
g++ -std=c++0x -c -o thefile.o thefile.cpp # ....