grasph / wrapit

Automatization of C++--Julia wrapper generation
MIT License
98 stars 12 forks source link

Add support for integral template parameters #27

Closed halleysfifthinc closed 8 months ago

halleysfifthinc commented 1 year ago

Integral type parameters require special handling in clang to extract/reproduce, and CxxWrap needs a specialization of BuildParameterList for the parametric type with the integral parameters.

I don't know if this will work for dependent(?) integral type parameters, along the lines of MyClass<typename T, T I>.

grasph commented 1 year ago

Thanks for your contribution. See the comment above concerning the code organization.

halleysfifthinc commented 1 year ago

It seems that GitHub lost your other comment?

grasph commented 1 year ago

Maybe you need to be logged in to see it. The comment was that the call to clang C++ API should be moved in a function put in the clang-ext.cpp. The idea is that all workarounds to deal with libclang limitations are grouped in this file and that they will replaced by proper libclang call when the libclang library will support the missing feature.

halleysfifthinc commented 1 year ago

Weird that I'm not seeing it. :man_shrugging: Anyways, sounds good re: keeping clang workarounds in clang-ext.cpp. I will work on reorganizing.

halleysfifthinc commented 1 year ago

Let me know if you want more of that separated out into libclang-ext, I moved what seemed to me to be the obvious "working around clang" parts.