[GCC-XML] Adding instantiated class template arguments to the output

Roman Yakovenko roman.yakovenko at gmail.com
Wed May 18 23:46:06 EDT 2005


Hi. 

I read FAQ. Sorry for long posting, I am just trying to present my use cases.

May I ask to add instantiation arguments of the class\function to the output?
For example: If I have vector<int>, gccxml will writes
vector<int,std::allocator<int> >.
Also it writes std::allocator<int> somewhere in the output. What I am
asking is next:

<Class id="_2100" name="vector<int,std::allocator<int> >" context="_2" ... >
    <Argument name="???" type="xxx"/>
    <Argument name="???" type="yyy"/>

Use cases:
When exposing C++ code to python using boost::python, user should specify 
in case of function "return value policy" 
in case of class "class holder"

In first case analyzing function return type could help code
generators to set right "return value policy". For example

std::auto_ptr<int> create(...){...}

In this case code generators could deduce that function return value
policy should be
return_value_policy<manage_new_object>.

Second case is very similar to first one, the only difference is that
code generators need to analyze function arguments too.

The only way to do it today is to parse relevant class name. It is
possible but dirty, error prone approach.

So the question: Brad could you add this? 

Thanks.

Roman



More information about the gccxml mailing list