Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-01-09 10:50:36


Oops, forgot about that!

Though I think the array_ref is still an important
class. It just wouldn't share implementation with array.
For the array_ref you couldn't use the initializer list,
so it would be ok to use the reversible_container_helper
(which perhaps should be added to boost/operators.hpp).

Nicolai Josuttis writes:
> jsiek_at_[hidden] wrote:
> >
> > There is a close relative to the array class that is also very
> > usefull: an array based on just a pointer to some memory "borrowed"
> > from somewhere else, an array_ref class.
> >
> > Here's an implementation of both array and array_ref. As you'll
> > see I had some fun with helper classes.
> >
> > Cheers,
> >
> > Jeremy Siek
> >
> Thanks Jeremy,
> but note that being able to use an initializer list doesn't allow
> base classes.
> The the upcoming new version for details.
>
> Question: Why static_cast for reverse iterators?

This is the barton & knakman trick... need to cast to
type C to get the begin()/end() member functions. This
is just like the operator[] in boost/operators.hpp.

Cheers,

Jeremy Siek


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