6
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’

Aaron McDaid
  • 26,501
  • 9
  • 66
  • 88
Martin
  • 9,089
  • 11
  • 52
  • 87

1 Answers1

9

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];
// ^^^^^^^^
Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249