[C++-sig] [Pyste] template instantiation with a user defined type

Nicodemus nicodemus at esss.com.br
Tue Apr 12 02:19:52 CEST 2005


Hi,

Jaroslav Gresula wrote:

> I have a problem with the following scenario:
>
> // -- file type.h
> class Type {};
>
> // -- file template.h
> template<class T>
> class Templ
> {
>   T m_data;
> };
>
> // -- test.pyste
> Type = Class( "Type", "type.h" )
> Templ = Template( "Templ", "template.h" )
> Templ( "Type" )
>
>
> When I run Pyste, it internally creates the following temporary file:
> // -- ~temporary
> #include "c:\absolute\path\to\template.h"
>
> typedef Templ< Type > Templ_Type;
> void __instantiate_Templ_Type()
> { sizeof(Templ_Type); }
>
> that is passed to gccxml which issues an error saying 'Type was not 
> declared in this scope'. Obviously, type.h header is missing.
>
> Is Pyste capable of handling a template specialized with a user 
> defined type?


Not right now, but I don't see why we can't add support for it. I belive 
this would cover all cases:

Templ( "Type", "type.h" )

and

Templ( Type )

I will implement this shortly in CVS.

Best Regards,
Bruno.



More information about the Cplusplus-sig mailing list