
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
"Doug Gregor" <dgregor@cs.indiana.edu> 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):
template<typename Range> typename range_const_iterator<X>::type const_begin(Range& rng) { return begin(static_cast<const Range&>(rng)); }
For one thing you can't use static_cast to change constness. I can't imagine why you'd want this first overload.
template<typename Range> typename range_const_iterator<X>::type const_begin(const Range& rng) { return begin(rng); }
That one works. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com