Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-11-30 14:07:59


In message <903j1b+g56r_at_[hidden]>, Giovanni Bavestrelli <giovanni.bav
estrelli_at_[hidden]> writes
>Array<int,3> A3(ArraySizes(10)(20)(30)); // 3D Array of ints

One area of possible improvement that I felt when reading the article
originally was in this area. Although I recognise there is no obvious
syntax, I am not enamoured of this one. What about <<? Or how about
something quite different:

        X(10) + X(20) + X(30)

Where X is an appropriate but short name we haven't yet thought of that
indicates dimension :->

In thinking about the whole dimension and sizing issue, I was wondering
about the following classification:

        size_type is the size_type in a given dimension
        resize resizes the base dimension wrt size_type
        size returns the length of the base dimension

        shape_type is the type that holds the size for each dimension
        reshape resizes all of the dimensions
        shape returns the sizes of all the dimensions

This seems in the spirit of the STL.

Thoughts?

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
____________________________________________________________


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