Vote count:
0
Is it possible to declare a function template instantiation?
It would express to the compiler that there exists a function template that has been instantiated somewhere with particular parameters.
// declaration of instantiation, perhaps it would look like this:
// template<typename> void foo(int);
void bar(int i) {
// definition of function unknown to caller, it shouldn't matter
foo(i);
}
I'm uncertain of the implications of type deduction here but the question would still stand if all types were explicit.
// template<typename> void foo<int>(int);
void bar(int i) {
foo<int>(i);
}
Is there a technical reason this can't be done or is it just for lack of syntax? Is there a reason that it's not possible to provide sufficient information in a declaration to generate calls to an instantiated function template?
asked 10 secs ago
Declare function template instantiation
Aucun commentaire:
Enregistrer un commentaire