Why won't this compile using DMD?

José Armando García Sancio jsancio at gmail.com
Sun Aug 12 13:30:09 PDT 2012


On Sun, Aug 12, 2012 at 1:18 PM, Simen Kjaeraas <simen.kjaras at gmail.com> wrote:
> On Sun, 12 Aug 2012 19:57:16 +0200, José Armando García Sancio
> <jsancio at gmail.com> wrote:
>
>> On Sun, Aug 12, 2012 at 7:31 AM, Simen Kjaeraas <simen.kjaras at gmail.com>
>> wrote:
>>>
>>> On Sun, 12 Aug 2012 09:39:13 +0200, Ivan Trombley
>>> <itrombley at dot-borg.org>
>>>>
>>>>      auto data = new Data(count);
>>>
>>>
>>>
>>> should be
>>>
>>> auto data = cast(shared)new Data(count);
>>
>>
>> Or
>> auto data = new shared(Data)(count);
>
>
> I thought I'd tried that. Maybe it was
>
> auto data = new shared Data(count);

Someone else may be better able to explain this but "most" D lex token
enclose until the end of the line unless de-marked with a pair of  ().
So I think 'new shared Data(count);' becomes 'new
shared(Data(count));'.


More information about the Digitalmars-d mailing list