
4 Nov
2011
4 Nov
'11
10:02 a.m.
Den 03-11-2011 16:15, Olaf van der Spek skrev:
A couple of years maybe. I think it happened at the same time we demanded that size(Rng) only worked for RandomAccessRanges and that this function also returns a signed type.
IMO the same arguments apply to that function.
Right. They should behave similarly, no matter what is decided that is the best.
Using the old docs, one can probably track down the approximate time.
The bottom line is that it was a deliberate decision. The example put forward
std::min(bbb.size(), (size_t)arr.size());
is not portable either.
My concern was about a.size()< b.size() where one size() returns a signed type and the other an unsigned type.
Yes, that happens a lot in C++. Not much we can do about it. -Thorsten