DMD 1.035 and 2.019 releases

Bill Baxter wbaxter at gmail.com
Wed Sep 3 18:00:57 PDT 2008


On Thu, Sep 4, 2008 at 9:50 AM, Ary Borenszweig <ary at esperanto.org.ar> wrote:
> Walter Bright a écrit :
>>
>> Chris R. Miller wrote:
>>>
>>> Walter Bright wrote:
>>>>
>>>> Sean Kelly wrote:
>>>>>
>>>>> Walter Bright wrote:
>>>>>>
>>>>>> Struct constructors!
>>>>>
>>>>> Must... have... D2.  :-)
>>>>
>>>> I figured you'd be seduced sooner or later!
>>>
>>> So this would make structs (in effect) classes that don't exist on the
>>> heap?
>>>
>>
>> No, structs do not inherit and do not have virtual functions.
>
> So both syntax are possible?
>
> S(...)
> new S(...)
>
> for a struct with a constructor? Is that documented anywhere?
>

I'm pretty sure that's:

S thing = S(...);
S* ptr = new S(...);

So yes both syntaxes are possible, but they are not synonyms.

--bb


More information about the Digitalmars-d-announce mailing list