
13 Jul
2011
13 Jul
'11
8:30 p.m.
Den 13-07-2011 22:24, Brian Wood skrev: .
Thanks. I found this thread which is closely related to what I'm wondering. http://boost.2283326.n4.nabble.com/Distance-size-of-boost-ranges-for-std-set...
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. -Thorsten