GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.46k stars 278 forks source link

Compilation errors with _fill(expression) method #392

Closed evan-barentin closed 11 months ago

evan-barentin commented 11 months ago

Hi!

In our code, we are using quite heavily explicit instantiation in order to gain some compilation time, but when switching from CImg 2.9 to a more recent version, we get the following compilation errors with both g++ & clang++:

./CImg.h:32705:14: note: '_fill' declared here
    CImg<T>& _fill(const char *const expression, const bool repeat_values, const unsigned int mode,
             ^
./CImg.h:29472:72: error: too many arguments to function call, expected 7, have 8
      return maxabs((+*this)._fill(expression,true,3,0,0,"maxabs",this,0));
                    ~~~~~~~~~~~~~~                                     ^
main.cc:3:31: note: in instantiation of member function 'cimg_library::CImg<>::maxabs' requested here
template struct cimg_library::CImg<float>;

Here is a small toy code which reproduces this behaviour:

#include "CImg.h"

template struct cimg_library::CImg<float>;

int main() { return 0; }

Thanks for all your work on this helpful library and have a nice day :)

dtschump commented 11 months ago

Thanks for reporting. I confirm the issue. Will work on a fix ASAP.

dtschump commented 11 months ago

It seems to work now, with my latest commits. I've just released on the website a new prerelease 3.2.7_pre, with the fix included. Could you tell me if that works for you ? Thanks!

evan-barentin commented 11 months ago

Hello

Thanks a lot for the quick response & fix! The latest pre-release works perfectly fine with both g++ & clang++ on my computer.

Sorry for the delay in the reply, I was away from computers from the last weeks…

Have a nice day