[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

declarations in for loops



Proposed:

That the traditional C++ ability to declare variables in for loops
be maintained, and maintain its traditional meanings, for example:

doFoo()
{
	for (int i=0; i<100; ++i)
		for (int j=0; j<i; ++j)
			doSomething(i,j);
}

*is* legal, and i's and j's scopes extend to the end of doFoo().

[disclaimer: this represents the opinions of an individual C++ user]