auto storage class - infer or RAII?

Bill Baxter wbaxter at gmail.com
Mon Nov 13 11:17:32 PST 2006


Kristian Kilpi wrote:
> On Mon, 13 Nov 2006 20:40:23 +0200, JC <johnch_atms at hotmail.com> wrote:

>>> Also I don't like this syntax. All variables should always be 
>>> declared  at
>>> the begining of blocks.
>>
>>
>> According to whom? That's a style thing, not a rule.
>>
> 
> Yes, that was just my humble opinion. :)
> 
> I just think that it would be consistent if all the variables will be  
> declared in the same place. 

You're free to have your opinion, but the C++ books I've read disagree 
with you.    The ones I've read advocate declaring variables as close to 
the point of usage as possible.  (Can't remember which books exactly, 
but probably Stroustrup and/or Meyers' books.)

--bb



More information about the Digitalmars-d mailing list