Create a naming convention for iterator variables #313
Labels
For:library
The issue is related to library (c++ implementation)
Priority:low
Work on this only when there is nothing else to do.
Type:discussion
A discussion of some particular topic in wider audience
It was decided that we will name iterator variables as
<the_name_of_the_object_we_get_by_dereferencing_the_iterator>_it
. We can slowly begin renaming all existing iterator variables to adhere to this convention.Const variables for iterators returned by
begin()
andend()
methods should be named<the_name_of_the_object_we_get_by_dereferencing_the_iterator>_begin
and<the_name_of_the_object_we_get_by_dereferencing_the_iterator>_end
, respectively.For example, for const iterator over StatePost, we get the following variable name:
When using the iterator over a small block of code (e.g., at most 3-line for loop), one can use just
it
and similar without having to specify the name of the object at all.Does anyone have any further comments or suggestions?
The text was updated successfully, but these errors were encountered: