mercredi 6 décembre 2017

c++11: Array bound is not an integer constant before a token

I have seen this question, but the solution provided there doesn't solve the issue.

static int num_instances; 
std::vector<SomeClass::FunctionWithinTheClass> *mem[num_instances];

the value num_instances is obtained by reading a configuration file.

The error I get is : array bound is not an integer constant before ‘]’ token

This is strange because the value num_instances is fixed at compile time.

Aucun commentaire:

Enregistrer un commentaire