Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-03-26 12:06:24


Potential solution to the problems with option 2).

  From operator[](range), return an indexer proxy that collects a list of
    ranges via operator[]. The operator[] for the last dimension returns a
    real subarray. If you don't want to specify all the dimensions,
    use the all() shortcut to cover the rest. For examp,e

  Suppose A is 2 dimensional

  A[3<=stride(1)<10][0<=stride(1)<5] // returns a subarray
  A[3<=stride(1)<10] // a compiler error, unless followed by more []'s
  A[3<=stride(1)<10].all() // same as A[3<=stride(1)<10][all]

Cheers,
Jeremy

On Mon, 26 Mar 2001, Jeremy Siek wrote:
jsiek> If we choose 2) we get the intended behaviour for
jsiek> "A[3<=stride(1)<10][2]" but now we have subarrays with
jsiek> different semantics than arrays. For example, the expression
jsiek> "B[0<=stride(1)<5]" will have a different meaning depending
jsiek> on whether B is an array, or if it is a subarray. Imagine
jsiek> calling a function which takes an array argument. The
jsiek> function would do very different things depending on
jsiek> whether you passed an array or subarray. I suppose we
jsiek> could have some function that resets the subscript
jsiek> dimension counter, but this seems dangerous.
jsiek>
jsiek> Cheers,
jsiek> Jeremy
jsiek>
jsiek> ----------------------------------------------------------------------
jsiek> Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
jsiek> Ph.D. Candidate email: jsiek_at_[hidden]
jsiek> Univ. of Notre Dame work phone: (219) 631-3906
jsiek> ----------------------------------------------------------------------
jsiek>
jsiek>
jsiek>
jsiek> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
jsiek>
jsiek>
jsiek> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
jsiek>
jsiek>
jsiek>

----------------------------------------------------------------------
 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