I could of course use is_base
if the base class where not a template. However, when it is, I just don't see any way to generically match any derived type. Here's 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 that to return true_
rather than false_
. The real example has like 7 template parameters, most defaulted, and uses Boost.Parameter to refer to them by name. In order to use is_base
I'd have to be able to pull the parameters out somehow and I don't see a way to do that short of declaring internal typedefs.
I think it's impossible. Looking to be proven wrong.