H
Hunter Hou
Folks,
If a member variable is initialized in class, it must be static and
const. I know this and regard it as a convention. But who knows why
standard define this? What's the advangtage or otherwise shortcomings?
For example,
class C {
const int a = 0;
static int a = 0;
// Must be like this:
static const int a = 0;
// or as an enum
};
Thanks,
Hunter
If a member variable is initialized in class, it must be static and
const. I know this and regard it as a convention. But who knows why
standard define this? What's the advangtage or otherwise shortcomings?
For example,
class C {
const int a = 0;
static int a = 0;
// Must be like this:
static const int a = 0;
// or as an enum
};
Thanks,
Hunter