Thread overview | |||||
---|---|---|---|---|---|
|
July 21, 2005 DMD 0.128: Alias arguments to a template cannot have default template values | ||||
---|---|---|---|---|
| ||||
This is allowed by the compiler: template A () { } class B (alias arg) { } class C : B! (A! ()) { } But this is rejected with the error string "Error: A!() is not a symbol": template A () { } class B (alias arg = A! ()) { } class C : B! () { } |
July 23, 2005 Re: DMD 0.128: Alias arguments to a template cannot have default template values | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | "Burton Radons" <burton-radons@smocky.com> wrote in message news:dbn2eh$1bbi$1@digitaldaemon.com... > This is allowed by the compiler: > > template A () { } > > class B (alias arg) { } > > class C : B! (A! ()) { } > > But this is rejected with the error string "Error: A!() is not a symbol": > > template A () { } > > class B (alias arg = A! ()) { } > > class C : B! () { } I cannot see any wrong behavior here. alias arg = something 'something' here should be some variable name but not a type name as in your example. |
July 23, 2005 Re: DMD 0.128: Alias arguments to a template cannot have default template values | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrew Fedoniouk | Andrew Fedoniouk wrote:
> "Burton Radons" <burton-radons@smocky.com> wrote in message news:dbn2eh$1bbi$1@digitaldaemon.com...
>
>>This is allowed by the compiler:
>>
>> template A () { }
>>
>> class B (alias arg) { }
>>
>> class C : B! (A! ()) { }
>>
>>But this is rejected with the error string "Error: A!() is not a symbol":
>>
>> template A () { }
>>
>> class B (alias arg = A! ()) { }
>>
>> class C : B! () { }
>
>
> I cannot see any wrong behavior here.
> alias arg = something
>
> 'something' here should be some variable name but not a type name as in your
> example.
It's an alias argument, it can take any scope - just as the first, working example shows.
|
Copyright © 1999-2021 by the D Language Foundation