Re: [Boost-users] multi_array: creating a view to a single element
![](https://secure.gravatar.com/avatar/fe709c2feb921b30e620c660e8bd7b33.jpg?s=120&d=mm&r=g)
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Baranowski, Daniel Sent: Wednesday, June 28, 2006 7:55 PM To: boost-users@lists.boost.org Subject: [Boost-users] multi_array: creating a view to a single element
[snip]
Basically, I have a 2 Dimensional array and I would like to be able to access the center of that array using a variable that maps to some index (for example, element[3][3] in a 7x7 array). [snip]
Would T & center = element[3][3] be satisfactory? I don't think multiarray supports any type of reallocation after construction, so it should be ok. Sohail
![](https://secure.gravatar.com/avatar/6db6d5adb2532988f0724fe596991e74.jpg?s=120&d=mm&r=g)
--- Sohail Somani wrote:
-----Original Message----- On Behalf Of Baranowski, Daniel [snip] Basically, I have a 2 Dimensional array and I would like to be able to access the center of that array using a variable that maps to some index (for example, element[3][3] in a 7x7 array). [snip]
Would T & center = element[3][3] be satisfactory?
Try:
typename boost::multi_array
I don't think multiarray supports any type of reallocation after construction, so it should be ok.
boost::multi_array has a resize() function, if that's what you're afraid of. See http://www.boost.org/libs/multi_array/doc/reference.html Cromwell D. Enage __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
participants (2)
-
Cromwell Enage
-
Sohail Somani