-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
In my c++ library I have multiple functions with non-type template arguments, e.g.
template <bool do_something = false>
void foo(int &x) {
...
if constexpr (do_something) {
...
}
}
The documentation has a clear method to generate python bindings for c++ functions with a template type. Is this type of templating supported and if so is there a clear method to implement a template argument?
I tried emulating the method for template types with no success
options.fn_template_options.add_specialization("foo", ["true"])
options.fn_template_options.add_specialization("foo", ["do_something=true"])
I end up with errors like
raise SrcmlcppException(f"Could not find a child of type {type_of_cpp_element}")
srcmlcpp.srcmlcpp_exception.SrcmlcppException: Could not find a child of type <class 'srcmlcpp.cpp_types.decls_types.cpp_decl_statement.CppDeclStatement'>
and
assert new_cpp_function is not None