dmd 1.070 and 2.055 release

Timon Gehr timon.gehr at gmx.ch
Thu Sep 8 11:43:49 PDT 2011


On 09/08/2011 08:31 PM, Timon Gehr wrote:
> On 09/08/2011 06:52 PM, Andrej Mitrovic wrote:
>> On 9/8/11, dsimcha<dsimcha at yahoo.com> wrote:
>>> Uh...what's wrong with this at the top of every file:
>>>
>>> alias toUTFz!(const(wchar)*) toUTF16z;
>>>
>>
>> Maybe this is wrong:
>>
>> Error: template instance toUTFz!(const(wchar)*) does not match any
>> template declaration
>
> Yes, I think it D should be enhanced so that it is possible to partially
> apply a template using alias, that would make alias a lot more useful.
>
> For now, this will do:
>
> auto toUTF16z(S)(S str){return toUTFz!(const(wchar)*)(str);}
>
>
> BTW, why does toUTFz!(const(wchar)*) not work with UFCS? Is that a bug?

Ah, I get it. k, imho toUTFz should be curried. That would make both the 
alias and UFCS work.


More information about the Digitalmars-d-announce mailing list