How do I use boost::multi_array with a templated argument?

I cannot get the code below to compile with g++-3.2 on GNU/Linux. The error message is: exempel.cpp: In member function `void functor<T>::operator()() [with T = P]': exempel.cpp:26: instantiated from here exempel.cpp:18: `nodetab' has incomplete type exempel.cpp:18: confused by earlier errors, bailing out Since everything is visible at compile time, I can't understand why I'm getting this error message, or what to do about it. ------------- #include <boost/multi_array.hpp> struct P {}; template<typename T> struct functor { typedef boost::multi_array<T, 3> table_t; typedef typename table_t::array_view<2>::type nodetab_t; typedef typename table_t::index_range range; void operator()() { table_t table(boost::extents[5][6][7]); nodetab_t nodetab = table[boost::indices[1][range()][range()]]; } }; int main() { functor<P> vis; vis(); return 0; } ------------- Björn
participants (1)
-
Björn Lindberg