From: Pavol Droba (droba_at_[hidden])
Date: 2003-11-03 03:18:20


On Mon, Nov 03, 2003 at 03:49:14PM +1100, Thorsten Ottosen wrote:

[snip]
 
> I don't agree. The current interface seems compatible with any type of
> ordered type:
>
> template< typename T >
> class range
> {
> T begin() const;
> T end() const;
> T size() const;
> bool empty() const;
> };
>
> AFAICT, only size() needs to be specialized for integers which should be
> easy using typetraits. So the same range class can easily support
> both iterators and integers.
>
> Moreover, the standard uses half-open ranges of the type

Actualy, it is not fully correct. 'iterator_range' is realy intended to work with
iterators only. Along with the operations you have specified, it has
a set of typedefs and operations are implemented using iterator operations.

I don't see a good reason why would we need to have a 'generic' all encompassing
range. 'iterator_range' is good for iterators and nothing else. Therefore
it is better to keep the name to reflect this point.

Regards,

Pavol