Boost logo

Boost Users :

From: Thomas Mensch (Thomas.Mensch_at_[hidden])
Date: 2004-10-02 10:26:34

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<double, 2> class. However I have problems
with the copy constructor of my class Array. Below is the code,
which I am trying to run.

#include <boost/multi_array.hpp>

class Array
  : public boost::multi_array<double,2>
  Array (void) :
    boost::multi_array<double, 2> ()

  Array (const int nrow, const int ncol) :
    boost::multi_array<double, 2> (boost::extents[nrow][ncol])

  Array (const Array& other) :
    boost::multi_array<double, 2> (other)

  ~Array (void)

  Array& operator= (const Array& rhs)
    if (&rhs != this)
    boost::multi_array<double, 2>::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

Many thanks in advance,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at