From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2007-03-01 08:56:51
> Thorsten Ottosen wrote:
>>Only for random access iterators. std::size() would only accept random
> Hmm, when should I use 'std::size'?
> Whenever the argument is known to be RandomAccessRange,
> the 'std::distance' is known to be O(1) complexity.
> Thus, I will always use 'std::distance'.
> (I actually replaced all the 'boost::size' in my codes
> by 'boost::distance'.)
Right, but size() adds a compile time check to that. Of course,
you may get that with a concept check in the beginning too.
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk