DMD 1.035 and 2.019 releases

Mosfet mosfet at anonymous.org
Wed Sep 3 05:11:36 PDT 2008


Ary Borenszweig wrote:
> Walter Bright a écrit :
>> To construct an object of struct S:
>>
>> auto s = S(arguments);
> 
while you are talking about, sorry to ask but what is the use of this 
keyword ?

When I look at documentation I can read :
The auto attribute is used when there are no other attributes and type 
inference is desired.

In which case you want inference type ? Is it a kind o C++ RTTI ?
In the sample code above, you already know that struct is of kind S.
First I thought auto means automatically destruct object when out of scope.








> Please add this example to the docs. I first thought you'd create a 
> struct like
> 
> auto s = new S(arguments);
> 
> (so that constructing something has a consistent syntax... so if then 
> you decide to change your struct to a class, or viceversa, and you don't 
> have to change a lot of bits everywhere)
> 
>>
>> Extrawurst wrote:
>>> Are opCalls deprecated now ? how do i call the ctor and how the 
>>> opCall? a short example in the docs would have been nice.











More information about the Digitalmars-d-announce mailing list