Re: STL iterators and for loops

2014-02-28 Thread Terrence Enger
On Fri, 2014-02-28 at 10:06 +0100, Stephan Bergmann wrote: > On 02/28/2014 06:42 AM, Tor Lillqvist wrote: > >> My builds with --enable-dbgutil are noticeably slow, > >> OTOH, hoisting vec.end() so > >> that is is called only once should be a quite mechanical task, > > > > Mechanical tasks are typic

Re: STL iterators and for loops

2014-02-28 Thread Stephan Bergmann
On 02/28/2014 06:42 AM, Tor Lillqvist wrote: My builds with --enable-dbgutil are noticeably slow, OTOH, hoisting vec.end() so that is is called only once should be a quite mechanical task, Mechanical tasks are typically those where it is very easy to miss some crucial detail in some case and in

Re: STL iterators and for loops

2014-02-27 Thread Tor Lillqvist
> My builds with --enable-dbgutil are noticeably slow, Well, that is more or less the point, isn't it? That shows that 1) the code is not compiled as optimised (and thus is easier to debug), and 2) it includes the extra debugging consistency checks etc. > So, possibly we do not care. I'd say tha

STL iterators and for loops

2014-02-27 Thread Terrence Enger
In the stackoverflow question "What does enabling STL iterator debugging really do?" [1], the top answer points out that creation and destruction of STL iterators in debug mode is comparatively expensive. The example given in the answer is: for (iterator_t it = vec.begin(); it != vec.e