Boost logo

Boost :

Subject: Re: [boost] [type_traits] templated type traits?
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2012-11-09 19:11:07


On 09/11/2012 08:45 p.m., Lorenzo Caminiti wrote:
> 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 uploaded template traits to the vault a long time ago. You can find it
at https://github.com/boost-vault/Miscellaneous as template_traits.zip,
or simply
https://github.com/boost-vault/Miscellaneous/blob/master/template_traits.zip

It works only for templates of type arguments, no non-type or template
arguments. There were other limitations, but I no longer remember them.

Agustín K-ballo Bergé.-
http://fusionfenix.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk