I'm trying to add a static constant variable to my class, which is an instance of a structure. Since it's static, I must initialize it in class declaration. Trying this code
class Game {
public:
static const struct timespec UPDATE_TIMEOUT = { 10 , 10 };
...
};
Getting this error:
error: a brace-enclosed initializer is not allowed here before '{' token
error: invalid in-class initialization of static data member of non-integral type 'const timespec'
How do I initialize it? Thanks!