|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2000-12-05 11:04:15
I really like this approach. Also, it could be generalized to a
"reshape_view" which can specify a different shape (dimensions and sizes)
ala Matlab. The 1xN (flat) view is probably a common enough case to treat
explicitly/separately as below.
On Tue, 5 Dec 2000, Kevlin Henney wrote:
> >All of those alls seem to hint at a commonality; better it would be
> >to support the all element interface through a view: -
> >
> > class flattened_array
> > {
> > public:
> >
> > flattened_array( array * );
> >
> > // insert clean container interface here.
> >
> > private:
> >
> > array * array_;
> > };
> >
> > class array
> > {
> > // ...
> >
> > flattened_array flat() { return flattened_array( this ); }
> > };
>
> This proxied view is a good, clean alternative to an adapted iterator.
>
> Kevlin
> ____________________________________________________________
>
> Kevlin Henney phone: +44 117 942 2990
> Curbralan Limited mobile: +44 7801 073 508
> mailto:kevlin_at_[hidden] fax: +44 870 052 2289
> http://www.curbralan.com
> ____________________________________________________________
>
>
>
>
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk