Descriptionhttps://sourceforge.net/p/testlilyissues/issues/5694/
1: iterate properly in reverse
The previous code would have malfunctioned for an empty container.
2: swap instead of copy
3: reduce repetition using a lambda function
4: use range-for loops
5: Dot_configuration "has a" instead of "is a" std::map
It is considered poor form to create subclasses of standard containers
because they lack virtual destructors. Inheriting privately from
std::map avoids potential problems by preventing Dot_configuration from
being treated as a std::map from the outside. (I didn't find any actual
problems in this case.)
Limiting the Dot_configuration interface to just the map methods that
are actually used makes it easier to understand how Dot_configuration is
used without searching the entire code.
Patch Set 1 : iterate properly in reverse #Patch Set 2 : swap instead of copy #Patch Set 3 : reduce repetition using a lambda function #Patch Set 4 : use range-for loops #Patch Set 5 : Dot_configuration "has a" instead of "is a" std::map #
Total comments: 1
MessagesTotal messages: 8
|