Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-09-16 00:49:26


"David Abrahams" <dave_at_[hidden]> wrote in message
news:uk6uvhw8w.fsf_at_boost-consulting.com...

| > > I wonder whether it's better to say
| > >
| > > cbegin(x)
| > >
| > > or
| > >
| > > begin(as_const(x))
| > >
| > > The latter is certainly more general.
| > >
| >
| > It's more general but it has a big usability issue: it's hard for me
| > to find a rationale that I can get a reverse_iterator by calling
| > "rbegin" but have to apply something to the container to get a
| > const_iterator.
| >
| > Whatever the best solution is, there should be the same concept for
| > const and reverse for the user!
|
| Just because the original designers made the mistake of building in
| rbegin() and rend() accessors, it doesn't mean we should perpetuate
| the same mistake for consistency.

no, not necessarily

| Orthogonality is better.

as_const() woul be othogonal to begin(), rbegin(), but there is a clear
difference between changing constness
and changing traversal direction.

The only "mistake" of rbegin() is that is it member even though it does not
have to be.

br

Thorsten


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