https://bugs.documentfoundation.org/show_bug.cgi?id=145538
Bug ID: 145538
Summary: Use range based for loops
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: difficultyBeginner, easyHack, skillCpp
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Since C++11, range based loops are available for iterating over a known
range of values. For example, when there is a need to process elements
of a container, range based loops are usually a good choice. They are
easy to write, read and understand.
This EasyHack is about using range based loops when it is more appropriate.
This is an example where range based loop was better suited:
Use range based for loops
https://git.libreoffice.org/core/+/47728bb925b33a8fe536fed8c913a2669bf101b6
Make sure that you understand where to use reference or const reference if
needed. A suggested reading:
https://blog.knatten.org/2013/10/13/prefer-using-references-with-range-based-for-loops/
--
You are receiving this mail because:
You are the assignee for the bug.