Open philtomson opened 6 years ago
The trick is to specialize jlcxx::BuildParameterList
, there is an example for this in https://github.com/JuliaInterop/CxxWrap.jl/blob/master/deps/src/jlcxx/examples/parametric.cpp for the type NonTypeParam
.
I notice in that example, though, that they specify the non-type values in the wrapping:
types.add_type<Parametric<jlcxx::TypeVar<1>, jlcxx::TypeVar<2>>>("NonTypeParam")
.apply<NonTypeParam<int, 1>, NonTypeParam<unsigned int, 2>, NonTypeParam<int64_t, 64>>(WrapNonTypeParam());
So they supply the values 1, 2 and 64 to NonTypeParam.
In my case, I'd like to be able to supply those parameters on the Julia side. I'd like to be able to do something like this on the Julia side:
foo = FixedPt{5,3}(8.2)
Is it possible?
I'm wondering if there is currently a way to wrap a templated struct like this where the template params are not types:
The template example in the README.md shows:
How would one go about specifying that the parameters there aren't types, but values?