Mam taki oto plik h
#ifndef DYNAMICMATRIX_H
#define DYNAMICMATRIX_H
#include <list>
#ifdef WINAPI_POINT_ENABLED
#define WIN32_MEAN_AND_LEAN
#include <windows.h>
#endif
using namespace std;
template <class TYPE>
class DYNAMICMATRIX
{
public:
DYNAMICMATRIX(){}
~DYNAMICMATRIX();
TYPE& operator()(int, int);
bool Add(int, int, TYPE);
bool Delete(int, int);
bool Fill(TYPE);
#ifdef WINAPI_POINT_ENABLED
TYPE& operator()(POINT);
bool Add(POINT, TYPE);
bool Delete(POINT);
#endif
private:
typedef list< list<TYPE>* > LISTX;
typedef list<TYPE> LISTY;
typedef list< list<TYPE>* >::iterator ITERATORX; //<- !!!
typedef list<TYPE>::iterator ITERATORY; //<- !!!
LISTX Matrix;
TYPE EmptyField;
bool Exist(int, int);
bool MoveIterator(ITERATORX&, int);
bool MoveIterator(ITERATORY&, int);
ITERATORX FindPlace(LISTX&, int);
ITERATORY FindPlace(LISTY&, int);
bool CmpX(TYPE, TYPE);
bool CmpY(TYPE, TYPE);
};
#endif
Do tego jeszcze na razie pusty plik .cpp z deklaracjami funkcji.
Dev wyrzuca mi takie oto błędy:
DYNAMICMATRIX.h:37: error: type `std::list<std::list<TYPE, std::allocator<_CharT> >*, std::allocator<std::list<TYPE, std::allocator<_CharT> >*> >' is not derived from type `DYNAMICMATRIX<TYPE>'
DYNAMICMATRIX.h:37: error: ISO C++ forbids declaration of `iterator' with no type
DYNAMICMATRIX.h:37: error: expected `;' before "ITERATORX"
DYNAMICMATRIX.h:38: error: type `std::list<TYPE, std::allocator<_CharT> >' is not derived from type DYNAMICMATRIX<TYPE>'
DYNAMICMATRIX.h:38: error: ISO C++ forbids declaration of `iterator' with no type
DYNAMICMATRIX.h:38: error: expected `;' before "ITERATORY"
DYNAMICMATRIX.h:44: error: expected `;' before '(' token
DYNAMICMATRIX.h:45: error: expected `;' before '(' token
DYNAMICMATRIX.h:46: error: `ITERATORX' does not name a type
DYNAMICMATRIX.h:47: error: `ITERATORY' does not name a type
Wiem, że błąd tkwi w tych dwóch instrukcjach typedef. Sprawdzałem jeszcze, czy dla int zamiast TYPE będzie wyrzucał takie same błędy - wszystko skompilowało się bez problemu.
Nie rozumiem, dlaczego wyrzuca mi błędy.
Byłbym wdzięczny, gdyby ktoś mi to wytłumaczył.