Article View: comp.lang.c++.leda
Article #99Re: data members of type "a LEDA type" / deriving from a LEDA type
From: Frank Muzzulini
Date: Tue, 26 Sep 1995 18:54
Date: Tue, 26 Sep 1995 18:54
41 lines
1662 bytes
1662 bytes
Bulent Basaran (basaran@prelude.ece.cmu.edu) wrote:
> Hi,
> I have two questions:
> 1) Is it possible to have a data member of a user class with a LEDA type?
> e.g.,
> class C1{
> array<string> A(0, 10); // an array of strings
> };
> This is not a valid c++ statement, since data members can not be initialized.
> Is there a way to correctly implement this?
When I remember correctly, you have to initalize the member *before* the
normal constructor. Try this:
class C1{
array<string> A;
C1() : A(0,10);
{ }
};
> 2) Is it possible to derive from a LEDA type?
> e.g.,
> class C1: public d_array {
> ...
> }
It is at least possible.
A friend of mine tried to code something like that, but he had some problems
in manipulating the object he derived from. Just try it.
Greetings, Muzz
--
___ Frank Muzzulini ua0y@rz.uni-karlsruhe.de Muzz@irc
<*,*> ... until the colour of a man skin is of no more
[`-'] significance than the colour of his eyes ... Bob Marley (War)
-"-"-
Technical Details
Message-ID:
<449i92$ae6@nz12.rz.uni-karlsruhe.de>Path:
arc1-ca.pugleaf.net!rzstud1.rz.uni-karlsruhe.de!ua0yReferences:
<199509251541.LAA02912@prelude.ece.cmu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!rzstud1.rz.uni-karlsruhe.de!ua0y From: ua0y@rzstud1.rz.uni-karlsruhe.de (Frank Muzzulini) Newsgroups: comp.lang.c++.leda Subject: Re: data members of type "a LEDA type" / deriving from a LEDA type Date: 26 Sep 1995 18:54:26 GMT Organization: University of Karlsruhe, Germany Message-ID: <449i92$ae6@nz12.rz.uni-karlsruhe.de> References: <199509251541.LAA02912@prelude.ece.cmu.edu> NNTP-Posting-Host: rzstud1.rz.uni-karlsruhe.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-User: ua0y X-Newsreader: TIN [version 1.2 PL2]