Hi everybody!
The project I'm working on contains a lot of tables, which are now defined as pointer-type arrays :
Code:
typedef struct {
string name;
double value;
int multiplicity;
} myParameters;
static const double just_some_parameters[] =
{
{"one", 1.0, 1},
{"two", 2.0, 2},
{"three", 3.0, 1},
{"four", 4.0, 2},
{"five", 5.0, 3},
};
I would like to convert this to a more STL like array, but then I'll probably need a (static) function to initialize my tables ? I mean:
Code:
typedef struct {
string name;
double value;
int multiplicity;
} myParameters;
static const std::vector<myParameters> = {} // will not work, of course
Any ideas of how to get rid of pointer-type arrays when using tables ?
Thanks for your answer!
Mark