[GCC-XML] Determining template parameter types

Roman Yakovenko roman.yakovenko at gmail.com
Sat Aug 2 13:07:27 EDT 2008


On Sat, Aug 2, 2008 at 7:09 PM, Chris Waldron <cwaldron at intrinsyc.com> wrote:
> As a feature request, it would nice if template parameter types can be added
> as an attribute of the Class Element. For example:
> template <typename P1, typename P2> TemplateClass {
>
>
>
> };
>
>
>
> class TemplateClass<void, int>
>
> {
>
>
>
> };
>
>
>
>
>
> <Class id="_10" name="TemplateClass<void,int*>" members="_23 _25 _26
> _27 _28 _29 _30 " bases="_21 _24 " tparams="_20 _21">
>
>     <Base type="_21" access="public" virtual="0" offset="12"/>
>
>     <Base type="_24" access="public" virtual="0" offset="0"/> </Class>
>
>
>
> The tparams attribute indicates the template parameter types defined on the
> class.  I cannot seem to find an easy way of determining the template
> parameter types from the XML output.

pygccxml does it right, in most cases:
http://www.language-binding.net/pygccxml/apidocs/pygccxml.declarations.templates-module.html

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the gccxml mailing list