Bonjour,
Je viens de créer une classe comportant un certain nombre de maps
Il semblerai que le compilo n'aime pas réellement que celles ci soient déclarées dans le .h
Par exemple les lignes de codes suivantes ne compilent pas :
le header ressemble à ça :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14 string Data::getStat(int chan) const { string ret; //map<int,float> _wrongGreenWormsPercent; map<int,float>::iterator iter; int first; float second; for( iter = _wrongGreenWormsPercent.begin(); iter != _wrongGreenWormsPercent.end(); iter++ ) { first=iter->first; second=iter->second; ret+=constructionS(first, second); } }
Par contre quand je décommente la déclaration de la map dans la fonction getStat ça compile...Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 class Data { private : [...] /* statistic atributes */ map<int,float> _wrongGreenWormsPercent; /* key : worm size, * data : percent of worms which have none waited value */ [...] public: [...] string getStat(int chan) const; [...] };
Est-ce que quelqu'un aurait une idée s'il vous plait?
le compilateur me retourne une erreur assez longue si elle est indispensable je la posterai.
Merci d'avance, Léo