I could, of course, use is_baseit if the base class is not a template. However, when this is the case, I simply donβt see a way to generally match any derived type. Here is a basic example of what I mean:
#include <boost/mpl/bool.hpp>
template < typename T >
struct test_base
{
};
template < typename T >
struct check : boost::mpl::false_ {};
template < typename T >
struct check<test_base<T> > : boost::mpl::true_ {};
struct test_derived : test_base<int> {};
#include <iostream>
int main()
{
std::cout << check<test_derived>::value << std::endl;
std::cin.get();
}
I want to return true_instead false_. This example has 7 template parameters, most defaults and uses Boost.Parameter to refer to them by name. To use is_base, I would have to somehow pull out the parameters, and I see no way to do this, not counting the internal typedefs.
I think it's impossible. Looking to be proven wrong.