Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit instantiation bug of CImgList #402

Closed
NeumoNeumo opened this issue Nov 19, 2023 · 1 comment
Closed

Explicit instantiation bug of CImgList #402

NeumoNeumo opened this issue Nov 19, 2023 · 1 comment

Comments

@NeumoNeumo
Copy link

NeumoNeumo commented Nov 19, 2023

When I try to instantiate CImgList in the latest commit like this

#include "CImg.h"
template struct cimg_library::CImgList<unsigned char>;

What I get from the compiler is

In file included from b.cpp:1:                                                                
./CImg.h:65161:29: error: cannot cast from type 'CImg<unsigned char>' to pointer type 'char *'
        CImg<charT>::string((char*)_data[l]).move_to(str);                                    
                            ^~~~~~~~~~~~~~~                                                   
b.cpp:3:31: note: in instantiation of member function 'cimg_library::CImgList<unsigned char>::
__display' requested here                                                                     
template struct cimg_library::CImgList<unsigned char>;                                        
                              ^                                                               
1 error generated.                                                                            
                                                                                              

Perhaps what you want in CImg.h is

CImg<charT>::string((char*)(_data[l]._data)).move_to(str);     
dtschump added a commit that referenced this issue Nov 19, 2023
@dtschump
Copy link
Collaborator

That's it, yes, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants