Is there equivalent of extends T>
, super T>
in C++?
Also, does extends T>
,
This worked for me:
#include
class MyBase {};
class A : public MyBase {};
class B {};
template
typename std::enable_if::value>::type
Foo(T &v) {
std::cout << "Foo 1" << std::endl;
}
template
typename std::enable_if::value>::type
Foo(T &v) {
std::cout << "Foo 2" << std::endl;
}
int main() {
A a;
B b;
Foo(a);
Foo(b);
return 0;
}