auto -> auto & var
Sebastián E. Peyrott
as7cf at yahoo.com
Sat Mar 11 21:14:03 PST 2006
In article <dutfq6$iul$1 at digitaldaemon.com>, Tom says...
>
>In article <op.s5732cfb6b8z09 at ginger>, Derek Parnell says...
>>
>>On Sat, 11 Mar 2006 09:20:25 +1100, Kramer <Kramer_member at pathlink.com>
>>wrote:
>>
>>> In article <dussar$2ihn$1 at digitaldaemon.com>, Nils Hensel says...
>>>>
>>>> Kramer schrieb:
>>>>> I don't know if anyone else agrees, but I wouldn't mind seeing auto's
>>>>> uses
>>>>> properly split:
>>>>>
>>>>> var -> type inference
>>>>> auto -> RAII
>>>>
>>>> Certainly gets my vote.
>>>>
>>>> Nils
>>>
>>>
>>> Or another alternative to minimize disruption for current auto use for
>>> type
>>> inference:
>>>
>>> auto -> type inference
>>> local -> RAII (I think I've seen this proposed before for RAII as well
>>> before)
>>
>>I don't care so long as 'auto' is not used to mean both. This is just such
>>an obvious wart in the language. Currently the language prevents one from
>>declaring a type-infered variable that is also RAII.
>
>Agree :o (I didn't realize that before). Serious issue.
>
>Tom;
I just realized I posted something meant for this thread somewhere else...argh,
I'm terribly sorry. Here it goes:
FWIW, I think Sean made a valid point. It should be possible to infer the type
of variable in its declaration and at the same time declare it as RAII object.
IMO, the worst thing about this are the implications behind the solution. How
much code would break if the keyword were to be changed for one or both cases?
If there's going to be a change, now may be the best time to do it...
--
Sebastián.
More information about the Digitalmars-d
mailing list