Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] sub_range and list not working together
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-07-13 16:30:04

Den 13-07-2011 22:24, Brian Wood skrev:
> Thanks. I found this thread which is closely related to what I'm wondering.
> I haven't checked into this much, but would using boost::distance
> when the underlying container is a deque or vector, be slower than
> using the container's size?

Not "big-O slower". But it all dependends on e.g. the vector
implementation. If size() is implemented as last - first, then it is the
same. If size is cached in the vector, then yes.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at