
10 Nov
2012
10 Nov
'12
4:45 a.m.
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. -- -Matt Calabrese