template <int N>
class myarray {
typedef int Bitmap;
public:
static Bitmap data[N];
};
template <int N> myarray<N>::Bitmap myarray<N>::data[N];
error: expected constructor, destructor, or type conversion before ‘myarray’
template <int N>
class myarray {
typedef int Bitmap;
public:
static Bitmap data[N];
};
template <int N> myarray<N>::Bitmap myarray<N>::data[N];
error: expected constructor, destructor, or type conversion before ‘myarray’
You need typename
before myarray<N>::Bitmap
because it is a dependent type:
template <int N>
class myarray {
typedef int Bitmap;
public:
static Bitmap data[N];
};
template <int N>
typename myarray<N>::Bitmap myarray<N>::data[N];
// ^^^^^^^^