I need to instantiate a templated function foo()
with a long signature, for some specific template arguments.
I just read the answers to this question which essentially suggest copying the function signature but setting the specific arguments. I want to avoid that somehow. What is a reasonable way to achieve this? e.g. something which would allow me to write
INSTANTIATE(foo, template_arg1, template_arg2);
or maybe
MyFunctionType<template_arg1, template_arg2> foo;
Just for illustrative purposes, suppose this is the code for foo
:
template<typename T, int val>
unsigned foo(
T bar,
SomeType baz1,
SomeOtherType baz2,
YetAnotherType you_catch_the_drift)
{
/* some code here */
}