Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2000-12-07 09:04:24

on 12/5/00 9:53 AM, Gavin Collings at gcollings_at_[hidden] 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 * );

I doubt that the array parameter should ever be NULL, so you could use a
reference parameter here. (The 'array_' member should still be a pointer.)
Either way, should this count as a conversion? If not, make the constructor

> // insert clean container interface here.
> private:
> array * array_;
> };
> class array
> {
> // ...
> flattened_array flat() { return flattened_array( this ); }
> };

Should flattened_array be a friend of array? If not, then flattened_array
has to work by translating array indices. If it does use indices, then we
could offer a FORTRAN-order version along with the normal (C-order) version.
FORTRAN-order puts the fastest index first instead of last.

Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

Boost list run by bdawes at, gregod at, cpdaniel at, john at