Subject: Re: [boost] [Range] Confusing result of iterator_range::size()
From: Sergey Voropaev (serge-voropaev_at_[hidden])
Date: 2011-11-03 05:35:48
Thorsten Ottosen <thorsten.ottosen <at> dezide.com> writes:
> The min() example that fails to compile is tricky...
This example is derived from real valid code.
> Even if we make it
> unsigned, size_types may differ (e.g. a 32 bit unsigned int and a 64 bit
Yes, but mostly all well-known containers use size_t as size_type.(I can imagine
container with 64 bit unsigned size in 32 bit programm, but it is not common
case). But using 32 bit int for size in programm will be error of programmer
but not error of container design. Container with signed int as size_type is
very unusual container.
iterator_range is used for modifying existing code too and mimicry with usual
container is important.
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