What help can Boost offer?

I often want to express intent of this sort... struct X {...}; void f( X & ); X my_array[3][6][11]; for (unsigned i=0;i!=3;++i) for(unsigned j=0;j!=6;++j) for(unsigned k=0;k!=11;++k) f( my_array[i][j][k] ); Apart from all the grottiness on hardcoded sizes and loop indices, which is just for exposition, is there a nice idiom in boost to do traversals over multiple indices in this way, or perhaps multiple ranges? Thanks, Rob.

struct X {...}; void f( X & );
X my_array[3][6][11];
for (unsigned i=0;i!=3;++i) for(unsigned j=0;j!=6;++j) for(unsigned k=0;k!=11;++k) f( my_array[i][j][k] );
Apart from all the grottiness on hardcoded sizes and loop indices, which is just for exposition, is there a nice idiom in boost to do traversals over multiple indices in this way, or perhaps multiple ranges?
In boost (and std::tr1) you've got "array" template which is static
array providing stl-compliant iterators. So you can write:
array

AMDG Robert Jones wrote:
I often want to express intent of this sort...
struct X {...}; void f( X & );
X my_array[3][6][11];
for (unsigned i=0;i!=3;++i) for(unsigned j=0;j!=6;++j) for(unsigned k=0;k!=11;++k) f( my_array[i][j][k] );
Apart from all the grottiness on hardcoded sizes and loop indices, which is just for exposition, is there a nice idiom in boost to do traversals over multiple indices in this way, or perhaps multiple ranges?
Dan Marsden was working on a library for this. http://lists.boost.org/Archives/boost/2008/01/132351.php In Christ, Steven Watanabe
participants (3)
-
Igor R
-
Robert Jones
-
Steven Watanabe