[multi_array] Create view at runtime

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

Hi Max, I'm afraid that you cannot switch the number of dimensions of a view at runtime, that's a property that is set at compile-time. The best you can do is end up with one dimension of size 1, i.e. instead of: [f ? range_t() : 11] use [f ? range_t() : range_t(11)] Cheers, ron On Dec 18, 2008, at 8:10 AM, loadcom wrote:
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
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
loadcom
-
Ronald Garcia