From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-03-01 10:02:14
Thorsten Ottosen wrote:
> shunsuke wrote:
>> Thorsten Ottosen wrote:
>>> Only for random access iterators. std::size() would only accept random
>>> access iterators.
>> 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.
I got it.
I should agree different functions should have
different names before wrapped around.
-- Shunsuke Sogame
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk