If I have
typedef Foo<float> Foof;
why can't I explicitly instantiate the template like this
template class Foof;
and is there a workaround apart from typing Foo<float>
?
and is there a workaround apart from typing Foo?
No, unfortunately there isn't. You have to type Foo<float>
. As to why, see 14.7.2 clause 3 of the C++ standard for the rule (I don't know the rationale behind the rule though).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With