
"Alexander Nasonov" <alnsn-boost@yandex.ru> wrote
#include <boost/mpl/assert.hpp> #include <boost/mpl/equal.hpp> #include <boost/mpl/vector_c.hpp>
char (&foo())[9][8][7][6];
int main() { using namespace boost::mpl;
typedef vector_c< int , sizeof(foo()) / sizeof(foo()[0]) , sizeof(foo()[0]) / sizeof(foo()[0][0]) , sizeof(foo()[0][0]) / sizeof(foo()[0][0][0]) , sizeof(foo()[0][0][0]) / sizeof(foo()[0][0][0][0]) > vec;
BOOST_MPL_ASSERT(( equal< vec, vector_c<int,9,8,7,6> > )); }
An interesting alternative. Instead of passing the desired vector position into foo(), just return everything in a multi-dimensional array. Have to give it more thought... Still don't see how it would help with ODR, though... Regards, Arkadiy