A range can be used to slice a Boost Multidimensional array (multi_array). According to the documentation there are several ways of defining a range, however not all of them will compile. I'm using GCC 4.5.2 on Ubuntu 11.04.
#include <boost/multi_array.hpp>
int main() {
typedef boost::multi_array_types::index_range range;
range a_range;
// indices i where 3 <= i
// Does compile
a_range = range().start(3);
// Does not compile
a_range = 3 <= range();
a_range = 2 < range();
return 0;
}
The compiler output is:
ma.cpp: In function ‘int main()’:
ma.cpp:9:26: error: no match for ‘operator<=’ in ‘3 <= boost::detail::multi_array::index_range<long int, long unsigned int>()’
ma.cpp:10:25: error: no match for ‘operator<’ in ‘2 < boost::detail::multi_array::index_range<long int, long unsigned int>()’
Any idea how I can compile this, or what is missing?