[comp.lang.c++] multi-dimension vectors of objects of a class

ping@cubmol.BIO.COLUMBIA.EDU (Shiping Zhang) (09/07/89)

Is there a way to declare a multi-dimension vector of objects of
a class? I just installed g++ on sun3 with os4. I got error messages
if I declared a multi-dimension vector of a class object, for example,

class vector {
//..
public
    vector(); // with no argument;
    ~vector();
//..
}
vector v1[4];    // works ok
vector v2[2][2];  // get fatal error message on this line

I want know if c++ does not support multi-dimension vectors of class
objects at all or only g++ doesn't, or simply it's a bug in the g++ I
just installed. I appreciate any help on this matter. Thank.


-ping

schmidt@zola.ics.uci.edu (Doug Schmidt) (09/08/89)

In article <333@cubmol.BIO.COLUMBIA.EDU>, ping@cubmol (Shiping Zhang) writes:
>Is there a way to declare a multi-dimension vector of objects of
>a class? I just installed g++ on sun3 with os4. I got error messages
>if I declared a multi-dimension vector of a class object, for example,
>
>class vector {
>//..
>public
>    vector(); // with no argument;
>    ~vector();
>//..
>}
>vector v1[4];    // works ok
>vector v2[2][2];  // get fatal error message on this line
>
>I want know if c++ does not support multi-dimension vectors of class
>objects at all or only g++ doesn't, or simply it's a bug in the g++ I
>just installed. I appreciate any help on this matter. Thank.

  The latest version of g++ (a 1.36 beta) compiles this without any
problems.  It must have been a bug with previous releases.  You can get
a copy of the beta g++ from labrea.stanford.edu, in the ~ftp/pub/gnu
directory.  The file is called g++.xtar.Z.  There is also a beta
release of libg++ 1.36 there also, called libg++.xtar.Z.

  Doug

--
schmidt@ics.uci.edu (ARPA) |   Per me si va nella citta' dolente.
office: (714) 856-4043     |   Per me si va nell'eterno dolore.
                           |   Per me si va tra la perduta gente.
                           |   Lasciate ogni speranza o voi ch'entrate.