Re:In the C++ bag of tricks: scoped locks
by plorkyeran on Friday February 07, 2014 @04:58PM
(#7199037)
C++ has variable shadowing, so that works correctly.
for (int i = 0; i < 5; ++i) {
for (int i = 0; i < 5; ++i) {
printf("hello\n");
}
}
prints hello 25 times.
Re:In the C++ bag of tricks: scoped locks
by VikingCoder on Friday February 07, 2014 @05:04PM
(#7199070)
Oh right. My brain was stuck in another language. Wow, I forgot how much I'd forgotten about C++.
Re:In the C++ bag of tricks: scoped locks
by JoeAltmaier on Sunday February 09, 2014 @11:29PM
(#7209124)
Actually that's just C (name nesting)
No, you can't, and no they don't.
That expands to: You end up with an i scoped inside another i.