[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: AW: AW: AW: non-locals are only sometimes global?
- From: David Kastrup <dak@...>
- Date: Thu, 22 Jul 2010 22:51:41 +0200
Florian Weimer <fw@deneb.enyo.de> writes:
> * David Kastrup:
>
>> "Warlich, Christof" <christof.warlich@thermofisher.com> writes:
>>
>>>> You've been using C/C++ too long :)
>>> Probably ;).
>>
>> I don't think that I have seen any C++ style guide encourage anything
>> but block local loop variables, written like
>>
>> for (int i=0; i<j; i++) ...
>
> You'll certainly find style guides which advocate the opposite.
Please give an example of such a style guide.
> There used to be a time when different compilers had different ideas
> about the scope of variables defined this way.
So what? In that case it will be good advice not to rely on the
variable running either out of scope or not at the end of the loop. But
that does not mean that it is a good idea to recycle loop variables.
So please point out a style guide which _does_ recommend that.
--
David Kastrup
- References:
- non-locals are only sometimes global?, Warlich, Christof
- Re: non-locals are only sometimes global?, steve donovan
- AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: non-locals are only sometimes global?, Peter Odding
- AW: AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: AW: non-locals are only sometimes global?, Peter Odding
- AW: AW: AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: AW: non-locals are only sometimes global?, Matthew Wild
- AW: AW: AW: non-locals are only sometimes global?, Warlich, Christof
- Re: AW: AW: AW: non-locals are only sometimes global?, David Kastrup
- Re: AW: AW: AW: non-locals are only sometimes global?, Florian Weimer