Article View: comp.lang.c++.leda
Article #112Re: data members of type "a LEDA type" / deriving from a LEDA type
From: Olivier L'Heureux
Date: Fri, 29 Sep 1995 08:52
Date: Fri, 29 Sep 1995 08:52
40 lines
2212 bytes
2212 bytes
In article <449i92$ae6@nz12.rz.uni-karlsruhe.de>
ua0y@rzstud1.rz.uni-karlsruhe.de (Frank Muzzulini) writes:
[...]
>> Bulent Basaran (basaran@prelude.ece.cmu.edu) wrote:
[...]
>> > 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.
C++ permits it, of course, but be very careful. Many LEDA classes have
been written without thinking about possible derivation.
For instance, the `graph' class is the base class for `GRAPH',
`ugraph' and `planar_map'. But a `ugraph' is a graph with its
`undirected' field set to true, thus the behaviour of the undirected
graph is (partly) implemented in the `graph' class. Thus, if you
derived from `graph', in order not to interfere with `ugraph', you
need to know that `graph' was written with `ugraph' in mind... Tricky.
It is one of the coding practice I regret in LEDA. I suppose it was
hardly avoidable.
>> ___ Frank Muzzulini ua0y@rz.uni-karlsruhe.de Muzz@irc
Olivier L'Heureux
----------------------------------------------------------------------
Laboratoire de microélectronique de l'Université catholique de Louvain
e-mail: lheureux@dice.ucl.ac.be B-1348 Louvain-la-Neuve
<URL:http://www.dice.ucl.ac.be/~lheureux> Belgium
MIME/PGP accepted
Technical Details
Message-ID:
<LHEUREUX.95Sep29095239@sphinx.dice.ucl.ac.be>Path:
arc1-ca.pugleaf.net!news.sri.ucl.ac.be!lheureuxReferences:
<199509251541.LAA02912@prelude.ece.cmu.edu> <449i92$ae6@nz12.rz.uni-karlsruhe.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.sri.ucl.ac.be!lheureux From: Olivier L'Heureux <lheureux@dice.ucl.ac.be> Newsgroups: comp.lang.c++.leda Subject: Re: data members of type "a LEDA type" / deriving from a LEDA type Date: 29 Sep 1995 08:52:39 GMT Organization: Lab. de Microelectronique - UCL - Belgium Distribution: world Message-ID: <LHEUREUX.95Sep29095239@sphinx.dice.ucl.ac.be> References: <199509251541.LAA02912@prelude.ece.cmu.edu> <449i92$ae6@nz12.rz.uni-karlsruhe.de> NNTP-Posting-Host: ns3.dice.ucl.ac.be Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit In-reply-to: ua0y@rzstud1.rz.uni-karlsruhe.de's message of 26 Sep 1995 18:54:26 GMT