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:
typename
myarray<N>::Bitmap
template <int N> class myarray { typedef int Bitmap; public: static Bitmap data[N]; }; template <int N> typename myarray<N>::Bitmap myarray<N>::data[N]; // ^^^^^^^^
Source: https://habr.com/ru/post/904127/More articles:Why does console.dir ('') print "no properties"? - javascriptWhy are String.prototype methods available for string literals? - javascriptJavaScript - a package is a reserved keyword - javascriptWhy does the JDK have both Math.random () and the Random class? - javaGeneric container for multiple data types in C ++ - c ++machine database - for mysql - databaseRetrieving Wikipedia info box content using jQuery - jquery@Singleton, @Startup, @PostConstruct does not work on EJB3.1 and Glassfishv3.0.1 - javaCan I use a random texture identifier? - c ++How to solve the "HeapWorker wedged in" error in Android? - androidAll Articles