Questions tagged [function-template]

12 questions
12
votes
2 answers

Is there a generic way to adapt a function template to be a polymorphic function object?

I have some function templates, for example template void foo(T); template void bar(T); // others and I need to pass each one to an algorithm that will call it with various types, e.g. template void…
HighCommander4
  • 50,428
  • 24
  • 122
  • 194
9
votes
1 answer

Is there such a thing as a function template template parameter?

So I know C++ has a feature called "template template parameters", where you can pass a class template as a template parameter. For example: template class vector { ... }; template