Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-09-15 14:59:46


"Jonathan Turkanis" <technews_at_[hidden]> wrote in message
news:cia4al$nfe$1_at_sea.gmane.org...
|
| "Doug Gregor" <dgregor_at_[hidden]> wrote in message:
|
| >
| > cbegin()/cend() aren't all that useful unless they also work with the
| > standard library containers. If it's never going to happen for the
| > standard containers, why bother putting it into Boost? Something like
| > "as_const(c)" is a totally different story, of course.
|
| Why can't const_begin be implemented as follows (for standard library
| containers):

well, it can...otherwise I wouldn't have made the post. It's similar to
rbegin(a) in the sense that it
only require a.begin()

| template<typename Range>
| typename range_const_iterator<X>::type
| const_begin(Range& rng)
| {
| return begin(static_cast<const Range&>(rng));
| }

this should not be needed, the next is sufficient

| template<typename Range>
| typename range_const_iterator<X>::type

X == Range

| const_begin(const Range& rng)
| {
| return begin(rng);
| }
|

br

Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk