Moze ktos sie juz spotkal z takim problemem:
mam szablon klas:
template <class Type>
class Zbior {
struct node {
int counter;
Type * item;
node * next;
node * prev;
node(): counter(0), item(NULL), next(NULL), prev(NULL) { };
};
static node * objects;
node funkcja();
}
i teraz jak próbuje zdefiniować ten statyczny wskaźnik:
template <class Type>
Zbior<Type>::node * Zbior<Type>::objects = NULL;
dostaje błąd:
zbior.h:62: error: expected constructor, destructor, or type conversion before ?*? token
gdzie linia 62 to definicja tego statycznego wskaźnika
ten sam błąd jest wyrzucany, gdy próbuje metodę funkcja zdefiniować poza ciałem klasy
template<class Type>
Zbior<Type>::node Zbior<Type>::funkcja() {
}
Ktoś wie jak to powinno prawidłowo wyglądać? Ewentualnie jak to ominąc/zapisać inaczej?