Add static const data to a struct already defined
- by Kyle
Since static const data inside a class is really just namespace sugar for constants I would think that
struct A {
float a;
struct B {
static const int b = a;
};
};
would be equivalent to
struct A {
float a;
};
struct A::B {
static const int b = a;
};
or something similar. Is something like this possible in C++? It would be useful for me to be able to tag class definitions that I'm pulling in from third party libraries with information like this.