Open
Description
We can't invoke the C++ compiler to generate new instantiations of templates, so I don't think we even try to keep track of them currently.
However, we could track explicit instantiations of template functions (14.7.2 in the standard) and make bindings to those.
For example, if given
template<class T> void foo(T t) { /∗ ... ∗/ }
template void foo(char);
template void foo(int);
We could generate something like:
extern "C" {
#[link_name = "..."]
pub fn foo_char(char);
#[link_name = "..."]
pub fn foo_int(int);
}
But either way, we can't create new template instantiations, so we shouldn't even try to generate bindings to generic functions based on the template, or to instantiations for which we haven't seen an explicit instantiation.