Разбираюсь с compile-time polymorphism. Правильно ли я понял что по сути дела он сводиться к перегрузке функций и специализации шаблонов?
// function overloading
void func(int) {
cout << "integer" << endl;
}
void func(std::string) {
cout << "string" << endl;
}
// template specialization
template <class T>
struct S {
const T sum(const T& a, const T& b) {
return a+b;
}
};
template <>
struct S<int> {
int mult(int a, int b) {
return a*b;
}
};
Этими возможностями исчерпывается compile-time polymorphism? Или есть еще что-то принципиальное?