The following code
template<int c>
struct Base
{
static const int a = c + 5;
};
template<int c>
struct Derived : Base<c>
{
static const int b = a + 5;
};
... fails to compile because a was not declared in this scope
. Explicitly specifying Base<c>::a
works, but logically this shouldn't be necessary because we're deriving from Base<c>
. Is this intended behaviour (and why) or am I missing something?