How to inherit from boost::multi_array
Dear List,
I am using boost 1.31.0 on Linux (with gcc 3.3.2)
I would like to create a 2D array class, which inherits from
boost::multi_array
On Oct 2, 2004, at 10:26 AM, Thomas Mensch wrote:
Dear List,
I am using boost 1.31.0 on Linux (with gcc 3.3.2) I would like to create a 2D array class, which inherits from boost::multi_array
class. However I have problems with the copy constructor of my class Array. Below is the code, which I am trying to run.
Greetings Thomas,
Though you did not supply the error message from your compiler, I
suspect that the problem is this: multi_array has a templated
constructor of the form:
template <class T> multi_array(T const&);
that will match your Array type better than the constructor with the
signature:
multi_array(multi_array
#include
class Array : public boost::multi_array
{ public: Array (void) : boost::multi_array () {} Array (const int nrow, const int ncol) : boost::multi_array
(boost::extents[nrow][ncol]) {} Array (const Array& other) : boost::multi_array
(other) {} ~Array (void) {}
Array& operator= (const Array& rhs) { if (&rhs != this) { boost::multi_array
::operator= (rhs); } return *this; } }; /* class Array */ I guess that I forget to provide some information to my derived class, but I cannot find which one. Is there a way to simply inherits from boost::multi_array?
Many thanks in advance,
Thomas
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Ronald Garcia
-
Thomas Mensch