I'm reading a book on C++ and for some reason I can't seem to understand Template Specialization (Implicit Template Instantiation, Explicit Template Instantiation, and Explicit Specialization). To be clear, I don't understand the need for explicit template instantiation or explicit specialization when one could just declare/define a non-template function, which would override both a generic template function and a specialization. Where, when, and why would you use explicit template instantiation and/or explicit specialization?
Aucun commentaire:
Enregistrer un commentaire