Opened 11 years ago

Last modified 10 years ago

#6240 new Feature Requests

iterator_size

Reported by: Olaf van der Spek <olafvdspek@…> Owned by: jeffrey.hellrung
Milestone: To Be Determined Component: iterator
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc: jeffrey.hellrung

Description

Could you add iterator_size to boost/iterator/iterator_traits.hpp?

It'd be size_t for pointers and, since std::iterator_traits does not yet define size_type, make_unsigned iterator_difference.

It'd be used for the size of a range as given by a valid pair of iterators.

Change History (8)

comment:1 by jeffrey.hellrung, 10 years ago

This seems to be more appropriately placed within the Range library than the Iterator library, doesn't it?

comment:2 by Olaf van der Spek <olafvdspek@…>, 10 years ago

Why? It's a trait of iterators.

comment:3 by jeffrey.hellrung, 10 years ago

Cc: jeffrey.hellrung added

comment:4 by jeffrey.hellrung, 10 years ago

IMO, it's more accurately a range trait. I don't see a context in which you'd speak of an "iterator's size type" outside of a range.

comment:5 by anonymous, 10 years ago

True, but the same applies to difference_type.

I don't really mind where this gets implemented though.

comment:6 by jeffrey.hellrung, 10 years ago

It looks like it's already implemented via boost/range/size_type.hpp, no? Would you be okay with closing this ticket?

Last edited 10 years ago by jeffrey.hellrung (previous) (diff)

comment:7 by anonymous, 10 years ago

Maybe, where is it documented?

comment:8 by Dave Abrahams, 10 years ago

Owner: changed from Dave Abrahams to jeffrey.hellrung
Note: See TracTickets for help on using tickets.