C++ template “deferred instantiation”
问题 What is meant with "deferred instantiation" in C++ templates? 回答1: Deferred instantiation is when the template is not instantiated until the corresponding entity is used for the first time. For example, you have a templated function: template<int Size> void YourFunction() { //does something } parameter Size can have any possible value that int can have. Do you automatically have the templated function instantiated for all possible values of Size ? No, the template is only instantiated for the