Bonjour à tous!
J'utilise une librairie image sous forme un seul include .h
Sous Code::Blocks, mon projet compile. Par contre, sous VC++.net, j'ai une erreur dans le .h ? Etrange quand même.
Voici le bout qui ne marche pas...

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
// Remove the image at position pos from the image list.
CImgl& remove(constunsignedint pos) {
if (shared)
throw CImgInstanceException("CImgl<%s>::remove() : Removal from a shared list is not allowed.",pixel_type());
if (pos>=size)
              cimg::warn(true,"CImgl<%s>::remove() : Cannot remove an image from a list (%p,%u), at position %u.",
              pixel_type(),data,size,pos);
else {
              data[pos].empty();
 
if (!(--size)) empty();

if (size<16 || size>allocsize/4) { // Removing item without reallocation.

       if (pos!=size) { 
                     std::memmove(data+pos,data+pos+1,sizeof(CImg<T>)*(size-pos));
                     CImg<T> &tmp = data[size];
                     tmp.width = tmp.height = tmp.depth = tmp.dim = 0; tmp.data = NULL;
              }
       } else { // Removing item with reallocation.
            allocsize/=4;
              CImg<T> *new_data = new CImg<T>[allocsize];
              std::memcpy(new_data,data,sizeof(CImg<T>)*pos);
            if (pos!=size) std::memcpy(new_data+pos,data+pos+1,sizeof(CImg<T>)*(size-pos));
            std::memset(data,0,sizeof(CImg<T>)*size);
            delete[] data;
              data = new_data; 
              }
       }
 return *this;
}
//! Remove last element of the list;
CImgl& pop_back() { remove(size-1); }
//! Remove first element of the list;
CImgl& pop_front() { remove(0); }
J'obtiens les erreurs suivantes:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
c:\documents and settings\gd280706\bureau\analyse ir\cimg.h(14712) : error C4716: 'cimg_library::CImgl<unsigned char>::pop_back' : doit retourner une valeur
c:\documents and settings\gd280706\bureau\analyse ir\cimg.h(14715) : error C4716: 'cimg_library::CImgl<unsigned char>::pop_front' : doit retourner une valeur
C'est bizarre non?
Il me semble que la fonction pop_back()renvoie bien une valeur (via remove?) Y a t-il un problème avec le passage par référence?
Pour info: CImg représente une image, et CImgl une liste d'image...

Merci à vous!