23 Oct
2002
23 Oct
'02
7:39 a.m.
Hi!
I'd like to have a class with a 4-D array. Initially it won't contain any data. However, Microsoft Visual C++ v6.0 complains about not finding a constructor.
I think the problem is, multi_array does not have a standard constructor. You have to provide the array size at construction time. In your example: Add a constructor foobar::foobar() : m_ar(boost::extents[r0][r1][r1][r3]) { } where r0...r3 is the maximum array size in the respective dimensions. Cheers, Klaus
I want to do something like this:
#include "boost/multi_array.hpp" typedef boost::multi_array<std::complex<double>, 4> t_Array4D;
class foobar { t_Array4D ar; };
void foobar::SetValue() { // set extents code
// set value this->ar[0][0][0][0] = 2.0; }