There are advantages / drawbacks of these two methods of repetition through the container / which you like and why: (MyClass :: iterator i = m.begin (), e = m.end (); i! = E; i ++) {// ...}
(MyClass>
for subsidiary question: i ++ or ++ i? Why?
"post-text" itemprop = "text"> If the itater is non-trivial (i.e., not an indicator), ++ I'm definitely fast because the copy is included in a temporarily Is not what can be optimized or not.
The first form is slightly faster but if you put things in the trash or loop then it can be wrong.
For normal recurrence on a container, I
#define foreach BOOST_FOREACH // in some header forwarding (mitype and element, any container) {// tackle the element }
Most of the time for condensation and clarity.
Comments
Post a Comment