S
saneman
I have made a template function i a .c++ file. But I can't call it from
main:
template <typename V>
void test_stack() {
V v;
}
int main(int, char**) {
test_stack()<int>;
}
I get the error:
In function ‘int main(int, char**)’:
error: no matching function for call to ‘test_stack()’
error: expected primary-expression before ‘int’
7: error: expected `;' before ‘int’
How do I call a template function?
main:
template <typename V>
void test_stack() {
V v;
}
int main(int, char**) {
test_stack()<int>;
}
I get the error:
In function ‘int main(int, char**)’:
error: no matching function for call to ‘test_stack()’
error: expected primary-expression before ‘int’
7: error: expected `;' before ‘int’
How do I call a template function?