On 11/25/2014 04:34 PM, Terrence Enger wrote:
The range-based `for` offers clearer code, IMHO. When, I wonder, is
it appropriate to use it?
(*) New code?
(*) When I am changing a for-statement anyway?
(*) Throughout a function when I am changing a for-statement anyway?
(*) Not at all until we are ready to make the change throughout the
system?
Similarly, what about `auto` type declarations (which often fit
naturally into variable definitions in a for-statement?
Both range-based for and auto are available across all compilers we
currently support, so feel free to use them in new code anyway. (The
only exemption is include files that are part of the URE interface.)
As to changing existing code, I think the answer is no different for
these C++11 features than for any other sort of clean up: There is no
hard and fast rules. Weigh "don't needlessly touch existing code"
against "keep the code clean and easily maintainable" and draw your
conclusion.
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice