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’Bu şablon tanımında yanlış olan nedir? Bir bağımlı tip olduğu için
İlgili: http://stackoverflow.com/questions/610245/where-and-why-do-i- -post-to-the-put-the-put-the-put-the-typename-keywords –
Şimdi aptalca bir takip sorusu için: Neden sadece son satırı silmiyorsunuz? Bu sadece ikinci bir deklarasyon değil mi? –
Doh! Şimdi görüyorum. Tanımsız referanslar. Bu gerekli * tanımıdır *, önceki satır ise sadece * bildirimdir *. –