Boost logo

Boost :

Subject: Re: [boost] [iterators] Proof-of-concept for a sentinel iteratoradapter
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-05-13 12:11:34


Giovanni Piero Deretta:
...
> > for( int i = 0; i < N; ++i )
> > {
> > m1 += test_strlen( "This is a test." );
> > }
>
>
> Are you sure the compiler is not computing the len at compile time?

Good point. Yes, it actually was computing it at compile time. When I
changed the test to use a literal in another TU, the sentinel iterator was
indeed more efficient:

953 (3577225856); 703 (3577225856)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk