std.allocator needs your help

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Sep 25 10:53:21 PDT 2013


On 9/25/13 9:13 AM, kraybit wrote:
> On 9/23/13 20:52 , Jacob Carlborg wrote:
>> On 2013-09-23 17:47, Manu wrote:
>>>    X x = new!(X!arg(args...)); // ewoo, paren spam...
>>
>> Why not:
>>
>> X x = new!X(args);
>>
>
> I believe Manu's example was about X having template parameters as well.
> As in
>      auto v = new Vec3!float(0,0,0);
>
>
> Either way, what would it be then? a) or b)?
>      auto v = new!(Vec3!float)(0,0,0); // a)
>      auto v = new!(Vec3!float(0,0,0)); // b)
> ?
>
>
> And which would be the same as:
>      auto v = new!Vec3!float(0,0,0);
> ?
>
> I'd assume it's the same as a), no?

I think there's no need to change the syntax of new, as long as it's 
lowered into a template. Right now it's special cased inside the compiler.

Andrei



More information about the Digitalmars-d mailing list