Is there real static polymorphism in C++?
问题 Here is a simple code in C++: #include <iostream> #include <typeinfo> template<typename T> void function() { std::cout << typeid(T).name() << std::endl; } int main() { function<int>(); function<double>(); return 0; } I have read that templates in C++ is a compile-time feature, which is not like generics in C#/Java. So as I understood, the C++ compiler will divide a single defined function into various number (depends on calls count with different type) of functions. Am I right or not? I'm not