[PyQt] Wrapping a scoped template type

Philip Lorenz lorenzph+sip at in.tum.de
Sun Mar 21 11:03:04 GMT 2010


On 03/21/2010 11:38 AM, Phil Thompson wrote:
> Do you want to define a template to SIP, or are you only interested in the
> <MyType>  version?
>
> If the latter then...
>
> %ModuleHeaderCode
> typedef std::set<MyType>::iterator MyTypeSetIterator;
> %End
>
> %MappedType MyTypeSetIterator
> ...
> %End
>
>    
This worked great. Thanks.
> If the former then the following might work...
>
> %ModuleHeaderCode
> typedef std::set<T>::iterator std::set_iterator<T>
> %End
>
> template<T>
> %MappedType std::set_iterator<T>
> ...
> %End
>
>    
Does not seem to work as C++ is currently lacking templated typedefs. 
However the first solution solves my case perfectly.


Philip


More information about the PyQt mailing list