Bonjour,

voilà l'erreur que je reçois et je ne comprends pas pourquoi mon compilateur (DEVC++) n'arrive pas à dissocier ma dernière classe (Cellule_2).

Voici le code pour vous faire voir. Mais avant, j'ai fait un test simple et qui marche :

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
template <class QQ>
class test1
{
 public : QQ a_;
 test1(QQ aa) {a_=aa;}
 QQ a() { return a_;}
 template <class PP> friend std::ostream& operator<<(std::ostream&,const test1<PP>&);
};
class test2
{
 protected : float b_;
 public :
 test2(float aa) {b_=aa;}
 float b() { return b_;}
 friend std::ostream& operator<<(std::ostream&,const test2&);
};
template <class QQ>
class test3 : public test1<QQ>,public test2
{
 public : 
 test3(QQ a,float b) :test1<QQ>(a),test2(b){}
 template <class PP> friend std::ostream& operator<<(std::ostream&,const test3<PP>&);
};
et dans un autre fichier les surchage de flux :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
template <class SS> std::ostream& operator<<(std::ostream& Stream,test1<SS>& aa)
    {     return Stream<<"( "<<aa.a()<<" ) ";    }
std::ostream& operator<<(std::ostream& Stream,test2& aa)
    {     return Stream<<"( "<<aa.b()<<" ) ";    }
template <class SS> std::ostream& operator<<(std::ostream& Stream,test3<SS>& aa)
    {     return Stream<<"( "<<aa.a()<<";"<<aa.b()<<" ) ";    }

Donc ça, ça marche!
Et ça : non :
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
class Coordonnee
{
 protected : 
 
   int coordx;
   int coordy;
 
 public :  
 
   Coordonnee(int x=1,int y=1)
     {
      coordx=x;
      coordy=y;
     }
 
   void coord(int& x,int& y)
     {
      x=coordx;
      y=coordy;
     }
 
   int x()
     {
      return coordx;
     }
 
   int y()
     {
      return coordy;
     }
 
   void change(int x,int y)
     {
      coordx=x;
      coordy=y;
     }
 
   virtual 
   bool appartient(int xmin,int xmax,int ymin,int ymax)
     {
      if(coordx>xmin && coordx<xmax && coordy>ymin && coordy<ymax)
        return true;
      else 
        return false;
     }
 
  friend std::ostream& operator<<(std::ostream&,const Coordonnee&);
  friend std::istream& operator>>(std::istream&,Coordonnee&);
};
 
/////
template <class TT>
class Case : public Coordonnee
{
 public : 
 
   TT valeur; 
 
   Case(int x=1,int y=1, TT value=0):Coordonnee(x,y)
     {
      valeur=value;
     }
   Case(Coordonnee coord, TT value=0):Coordonnee(coord)
     {
      valeur=value;
     }
 
  template<class TT2>
  friend std::ostream& operator<<(std::ostream&,const Case<TT2>&);
 
};
/////
/////
 
template <class VV>
class Case_physic : public Case<VV>
{
 private : 
   VV valmin;
   VV valmax;
 
 public : 
 
   Case_physic(int x=1,int y=1,VV value=0,VV max=65536, VV min=0) : Case<VV>(x,y,value)
     {
      if(min<=max)
        {
         valmin=min;
         valmax=max;
        }
      else
        {
         valmin=max;
         valmax=min;
        }
     }
 
   Case_physic(Case<VV> Caz,VV max=65536,VV min=0) : Case<VV>(Caz)
     {
      if(min<=max)
        {
         valmin=min;
         valmax=max;
        }
      else
        {
         valmin=max;
         valmax=min;
        }
     }
 
   virtual
   VV Min()
     {
      return valmin;
     }
 
   virtual
   VV Max()
     {
      return valmax;
     }
 
  template<class WW2>
  friend std::ostream& operator<<(std::ostream&,const Case_physic<WW2>&);
 
};
 
/////
class Neighb
{
 protected : 
 
   int id_voisinage;
 
 public : 
 
   Neighb(char *vois="8")
     {
      if(strcmp("8",vois)==0) 
        id_voisinage=1;
      else
        if(strcmp("croixplus",vois)==0) 
          id_voisinage=2;
        else
          if(strcmp("croixfois",vois)==0) 
            id_voisinage=3;
          else
            if(strcmp("lig",vois)==0 || strcmp("-",vois)==0) 
              id_voisinage=4;
            else
              if(strcmp("col",vois)==0 || strcmp("|",vois)==0) 
                id_voisinage=5;
              else
                if(strcmp("diag1",vois)==0 || strcmp("\\",vois)==0) 
                  id_voisinage=6;
                else
                  if(strcmp("diag2",vois)==0 || strcmp("//",vois)==0) 
                    id_voisinage=7;
                  else
                    if(strcmp("perso",vois)==0 ) 
                      id_voisinage=8;
                    else
                      id_voisinage=0;
     }//fin Neighb
 
   char *voisinage()
     {
      switch(id_voisinage)
        {
         case 1 : return "8";break;
         case 2 : return "croixplus";break;
         case 3 : return "croixfois";break;
         case 4 : return "lig";break;
         case 5 : return "col";break;
         case 6 : return "diag1";break;
         case 7 : return "diag2";break;
         case 8 : return "perso";break;
         default : return " ";break;
        }
     }//fin voisinage()
 
  friend std::ostream& operator<<(std::ostream&,const Neighb&);
 
};
/////
template <class UU>
class Cellule_2 : public Case_physic<UU> , public Neighb
{
 public : 
 
 Cellule_2(int x=1,int y=1,UU value=0,UU max=65536, UU min=0,char *vois="8")
 :Case_physic<UU>(x,y,value,max,min),Neighb(vois)     {}  
 
 template<class UU2>
   friend std::ostream& operator<<(std::ostream&,const Cellule_2<UU2>&);
};
et pour les flux :
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
35
36
37
38
39
40
41
42
43
44
45
//Coordonnee : 
  std::ostream& operator<<(std::ostream& Stream,Iam::Coordonnee& xy)
    {
     Stream<<"( "<<xy.x()<<" ; "<<xy.y()<<" )";
     return Stream;
    }
 
  std::istream& operator>>(std::istream& Stream,Iam::Coordonnee& xy)
    {
     int a,b;
     Stream>>a>>b;
     xy.change(a,b);
     return Stream;
    }
 
//Case : 
  template<typename TT2>
  std::ostream& operator<<(std::ostream& Stream,Case<TT2>& caz)
    {
     return Stream<<"( "<<caz.x()<<" ; "<<caz.y()<<" )"<<" : "<<caz.valeur;
    }
 
//Case_physic : 
  template<typename TT2>
  std::ostream& operator<<(std::ostream& Stream,Case_physic<TT2>& caz)
    {
     return Stream<<"( "<<caz.x()<<" ; "<<caz.y()<<" )"<<" : "<<caz.valeur
     <<endl<<" [ "<<caz.Min()<<" ; "<<caz.Max()<<" ]";
    }
 
//Neighb : 
   std::ostream& operator<<(std::ostream& Stream,Neighb& neib)
    {
     return Stream<<" de voisinage "<<neib.voisinage();
    }
 
//Cellule_2 : 
 template<class UU>
   std::ostream& operator<<(std::ostream& Stream, const Cellule_2<UU>& cell2)
    {
     //Case_physic<UU> caz_phy=(Case_physic<UU>)cell2;
     //Neighb neib=(Neighb)cell2;
     //return Stream<<caz_phy<<neib;
     return Stream<<"voici : ";//<<cell2.x()<<" . "<<cell2.voisinage();
    }
Si vous trouvez où est le pb... j'suis preneur!!!

Merci d'avance.