Boost logo

Boost Users :

Subject: [Boost-users] [multi_array] Create view at runtime
From: loadcom (loadcom_at_[hidden])
Date: 2008-12-18 09:10:03


Hello,

I'm using boost::multi_array of boost 1_36_0 with VS2003SP1.

I hope I could determine the number of dimensions of a view
of a given multi_array at runtime, or something like this:

typedef boost::multi_array<int, 5> array_t;
typedef typename array_t::index_range range_t;

array_t array;
// ...
bool f;
array_t::array_view<_>::type view =
    grid[boost::indices[f? range_t() : 11]
    [f? range_t(1,2): range_t()][rang_t]];

I'll be appreciated to have any kind of help.

B/Rgds
Max

-------------------------------------------------------------------
ÐÂÀ˿ռ䡪¡ªÓëÅóÓÑ¿ªÐÄ·ÖÏíÍøÂçÐÂÉú»î£¡(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