[PyQt] How to derive from a %MappedType?

Shaheed Haque srhaque at theiet.org
Sat May 27 16:00:42 BST 2017


Hi Phil,

On 26 May 2017 at 16:47, Shaheed Haque <srhaque at theiet.org> wrote:
>
>
> On 26 May 2017 13:26, "Phil Thompson" <phil at riverbankcomputing.com> wrote:
>
> On 25 May 2017, at 11:16 pm, Shaheed Haque <srhaque at theiet.org> wrote:
>>
>> Hi Phil,
>>
>> I'm finally looking to extend my generator to handle templated
>> classes, and am finding a curious result from some initial tests. As
>> per the example you provided, this SIP compiles just fine:
>>
>> template<T>
>> class MyTemplate
>> {
>> public:
>>    MyTemplate();
>> };
>>
>> The issue is that nesting in an OuterClass like this gives a syntax error:
>>
>> class OuterClass
>> {
>> template<T>
>> class MyTemplate
>> {
>> public:
>>    MyTemplate();
>> };
>> };
>>
>> Nesting in a namespace compiles just fine. Is that expected?
>
> Current hg (and tonight's snapshot) should parse it. I haven't tested the
> generated code - but (given it already works with namespaces) it has a
> reasonable chance of working.
>
> Phil
>
>
> Cool. I will take a look. Thanks!
>

I patched my code with the change, and it now compiles! (I'm still not
really looking at the generated code, for now, I'm happy to get it
compiling).

Thanks, Shaheed


More information about the PyQt mailing list