I want to instantiate
template<typename T> void foo(
T& t,
SomeType some_parameter,
AnotherType another_parameter,
EtcType yet_another_parameter,
AsYouCanTell this_is_a_very_long_signature);
that is, a function with a long signature. Now, I know how to do this:
template void foo<int>(
int& t,
SomeType some_parameter,
AnotherType another_parameter,
EtcType yet_another_parameter,
AsYouCanTell this_is_a_very_long_signature);
But I have to duplicate the signature. Also, what if want specific instantiation for 5 different types - do I copy it 5 times? Doesn't make sense...
I was thinking maybe I could write
template decltype(foo<int>);
but for some reason this doesn't work. Why?
template foo<int>(int&, SomeType, AnotherType, EtcType, AsYouCanTell);
. You can further shorten the type names by using type aliases. – dyp