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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…