
On Fri, Nov 9, 2012 at 8:45 PM, Matt Calabrese <rivorus@gmail.com> wrote:
On Fri, Nov 9, 2012 at 6:45 PM, Lorenzo Caminiti <lorcaminiti@gmail.com>wrote:
Hi,
Is there a way to inspect if a type is a template instantiaton (is_templated) and the type of the instantiated template parameters (arg1_type)?
is_templated< std::vector<int> >::value // true is_templated< int >::value // false
template_traits< std::vector<int> >::arg1_type // int
I recently developed a way to do this in the backend of Boost.Generic that works even with non-type template parameters or combinations of types an non-types, etc., but it requires explicit registration of those kinds of "weird" template parameter lists, which might be unacceptable for your needs.
Thanks for all the replies. It turns out the solution to the question I originally asked doesn't help in the context of my original problem :( but thanks for telling me how to inspect template traits! --Lorenzo