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
Mais dans le fichier CPP au moment de d�clarer ma fonction append, mon typedef est mal g�r�:
Code : S�lectionner tout - Visualiser dans une fen�tre � part
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__
Aucune version ne compile. Comment faire un typedef ind�pendant de T ?
Code : S�lectionner tout - Visualiser dans une fen�tre � part
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) { ... }
MERCI
Partager