I've got a templated class mostly dedicated to holding a boost:: multi_array. I am trying to initialize the array in the initialization class, but I am getting an error:
template <typename T>
class Hist2D
{
private:
typedef boost::multi_array<T, 2> array_type;
array_type MatrixCount;
public:
Hist2D(int width, int height): array_type MatrixCount(boost::extents[width][height]){};
};
This gives the following error:
ctest.cpp: In constructor ‘Hist2D<T>::Hist2D(int, int)’:
ctest.cpp:34:45: error: expected ‘(’ before ‘MatrixCount’
Hist2D(int width, int height): array_type MatrixCount(boost:extents[width][height]){};
^
ctest.cpp:34:45: error: expected ‘{’ before ‘MatrixCount’
What do these errors mean?
array_type MatrixCount;withint MatrixCount;, would this make sense?Hist2D() : int MatrixCount(10) {}