In C++, suppose I write a template function
template<typename T>
void func(T obj){
obj.print();
}
But for some class, there might be not print() member function defined, which causes compilation errors. However, obj.print() may be not so important. Instead of add print() to the class, I prefer to make print() not called.
This may be a weird question. But just wondering if anyone ever saw such question.