Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-09-16 14:20:13


From: "Jonathan Turkanis" <technews_at_[hidden]>
> "David Abrahams" <dave_at_[hidden]> wrote in message
> news:u3c1jhvz5.fsf_at_boost-consulting.com...
> > "Jonathan Turkanis" <technews_at_[hidden]> writes:
>
> > > 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.
>
> Are you sure? The expression

Yep. See 5.2.9. You'll see what static_cast can do, and then
5.2.9/3 specifically excludes any other conversions. Modifying
cv qualification is not among the things static_cast can do.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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