I believe I had seen macro in boost that recovers template template parameters, for example:
template<class>
struct parameters;
#define parameters(T) template<class A> \
struct parameters<T<A> > { typedef A type1; };
is there one like this, or am I wrong?
Thank you
delctypesupport in C++0x makes this fairly trivial to implement:(Though you need a separate get_type definition for templates with 2, 3, 4, etc parameters.)
Unfortunately, I don’t think there is a way to do this without decltype, because to do so required automatic the type-deduction provided by function templates (which is not available for class templates) and so there’s no way to make a typedef that way.
I don’t know off-hand if boost has anything like this already, but if they do it will still require your compiler to support
decltype, but since decltype is so new there is not a lot of stuff in boost that uses it yet (though there is some).