There are classes A and B. How to check that B is inherited from class A? Compile-time task.
It could be useful for someone:
template<typename A, typename B>
class isd
{
class no{};
class yes{no[2]};
static yes test(B*);
static no test(...);
public:
enum {is=sizeof(test(static_cast<A*>(0)))==sizeof(yes)};
};
Just read the code..........................
Now you understand what this code is made for?! Do you see the power?!
This is just an ART, isn't it?
Extensible Templates: Via Inheritance or Traits?