template<class T> et typedef indépendant de T
Bonjour,
j'ai déjà développer sous visual sans soucis, mais ici à la maison pour un projet perso je suis passée à Code::Blocks, et là je n'arrive pas à compiler ma class template
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#ifndef __UTL_List_INTERFACE__
#define __UTL_List_INTERFACE__
#include <iostream>
#include <stdlib.h>
using namespace std;
template <typename T>
class UTL_List
{
public:
typedef unsigned int count_type;
typedef unsigned int capacity_type;
UTL_List(capacity_type capacityStep = 1);
virtual ~UTL_List();
T* get(count_type index) const;
count_type append(T* elem);
protected:
private:
T* _elems;
count_type _count;
capacity_type _capacity;
capacity_type _capacity_step;
};
#endif // __UTL_List_INTERFACE__ |
Mais dans le fichier CPP au moment de déclarer ma fonction append, mon typedef est mal géré:
Code:
1 2 3 4 5 6 7 8 9 10
|
template <class T>
UTL_List::count_type UTL_List<T>::append(T* elem)
ou
UTL_List<T>::count_type UTL_List<T>::append(T* elem)
ou
UTL_List<class T>::count_type UTL_List<T>::append(T* elem)
{
...
} |
Aucune version ne compile. Comment faire un typedef indépendant de T ?
MERCI