Boost logo

Boost Users :

Subject: Re: [Boost-users] [MultiArray] Bounds Guarding in array_view for (stride>1)
From: Max (loadcom_at_[hidden])
Date: 2008-12-21 19:31:53


Perhaps I've not described the question quite clear. :-(

What I mean is in the cases the specified stride > 1, will
it cause undefined bahavior if I define the range of one
dimention as

range_t(first, last+stride-1, stride)

(I know the correct form is range_t(first, last+stride, stride))

Thanks for any explanation.

Max


----- Original Message -----
From: loadcom
To: boost-users
Subject: [Boost-users] [MultiArray] Bound Guarding
Date: 2008-12-21 09:29:55

Hello,



I'm using boost::multi_array for a while and find it very powerful

except one point that I cannot specify an array_view's number of

dimentions at runtime. But this pity is not the topic of this post.



You know one can create an array_view with arbirary given start/bound

indices as well as the stride as follows:



typedef boost::multi_array array_t;

array_t myarray;

//...

typedef array_t::index_range range_t;

typename array_t::array_view::view myview =

    myarrray[boost::indices[range_t(0, 8, 2)][rang_t()][1]];



As I don't know in the internal of the lib how the dound guarding of

iteration is done, either



- in the 'standard' STL manner as i!=bound; or

- in the 'conventional' C stale as ihttp://space.sina.com.cn/ )

-------------------------------------------------------------------
ÐÂÀ˿ռ䡪¡ªÓëÅóÓÑ¿ªÐÄ·ÖÏíÍøÂçÐÂÉú»î£¡(http://space.sina.com.cn/ )


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net