Is D 0.163 D 1.0?

Dave Dave_member at pathlink.com
Mon Jul 24 16:44:40 PDT 2006


Regan Heath wrote:
> On Mon, 24 Jul 2006 17:48:52 -0500, Dave <Dave_member at pathlink.com> wrote:
>> Sean Kelly wrote:
>>> Regan Heath wrote:
>>>> On Mon, 24 Jul 2006 06:58:39 -0700, Sean Kelly <sean at f4.ca> wrote:
>>>>> Chris Nicholson-Sauls wrote:
>>>>>>  And I believe this is what is used in the new edition of C# for 
>>>>>> type inference, yes?
>>>>>
>>>>> Yes, though 'auto' will be used for type inference in C++.  
>>>>> Personally, I'd prefer scoped destruction to use a keyword such as 
>>>>> 'local' or 'scoped' than to change the keyword used for type 
>>>>> inference.
>>>>
>>>> I'd prefer scoped destruction to simply omit the 'new' keyword, eg.
>>>>
>>>> class A {}
>>>>
>>>> A a = new A(); //normal
>>>> A a = A(); //destroyed at end of scope
>>>>
>>>> and with auto..
>>>>
>>>> auto a = new A(); //normal
>>>> auto a = A(); //destroyed at end of scope
>>>>
>>>> Simple, elegant, obvious (IMO)
>>>
>>
>> So do I.
>>
>>> I like this too, though it doesn't address being able to label a 
>>> class as 'auto'.  But perhaps that syntax can stay as-is?
>>
>> I think so too.
> 
> Or the keyword can be changed to something else. I have to admit I've 
> never really liked this usage of auto, it places restrictions on my 
> usage of the class.. I prefer to have full control over how I use them, 
> even if it means I might forget.
> 
> Regan

Heck, I don't care if it stays 'auto class ...' or not unless that makes 
it more likely for the first idea to be implemented :)

The problem I can see with 'A a = A()' would be that people would expect 
it to be stack allocated (and that's never going to happen for v1.0) but 
it is still my preference over the long haul so I'd live with it.

Auto type inference and auto dtors are both great features and it's a 
shame if they couldn't be used together, though personally I don't think 
this should hold v1.0 up because there is a simple workaround.



More information about the Digitalmars-d mailing list