DMD 0.177 release
Thomas Kuehne
thomas-dloop at kuehne.cn
Wed Dec 20 08:08:04 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrei Alexandrescu (See Website For Email) schrieb am 2006-12-20:
> Thomas Kuehne wrote:
>>> We then discussed another solution that I won't bore you with, as it's
>>> so wrong it hurts. My current thoughts navigate around two possible
>>> solutions. One is to make the storage part of the template parameters:
>>>
>>> template ident(S T) {
>>> S T ident(S T e) { return e; }
>>> }
>>>
>>> When two adjacent symbols appear in a template parameter list, they
>>> unambiguously denote a storage class followed by a type. So "S" can bind
>>> to things like "in", "inout" etc., while "T" can bind to types.
>>
>> Unambiguously?
>>
>> template Templ_1(int i) {
>> }
>>
>> Is "int" now a type or a storage class?
>
> It's a type because the symbol "int" is already bound as a keyword.
> There's no way (to the best of my knowledge) to specify two adjacent
> non-keyword symbols in a template parameter list.
enum S{ FOO }
template Templ(S T) { }
mixin Templ!(S.FOO) bar;
Do you consider S an keyword here?
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFiWtKLK5blCcjpWoRAnRTAKCLuXgE7qH/OyabfPJ3aGaPRT0IaQCeLFy2
3PDyDfn8rcPDXpKq+m572HQ=
=l6HF
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-announce
mailing list