struct _ {}; template <class F, class T1> struct apply; template <template <class> class F, class T1> struct apply<F<_>, T1> { typedef typename F<T1>::type type; }; #include <boost/type_traits/is_same.hpp> #include <boost/static_assert.hpp> template <class T> struct add_ptr { typedef T* type; }; typedef add_ptr<_> a; typedef apply<a, int>::type p; BOOST_STATIC_ASSERT((boost::is_same<p, int*>::value)); int main(){}