home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!unipalm!uknet!mcsun!sunic!seunet!abbaut!dlarsson
- From: dlarsson@aut.abb.se (Daniel Larsson)
- Newsgroups: comp.lang.c++
- Subject: Re: Renaming
- Message-ID: <1992Sep8.183745.555@aut.abb.se>
- Date: 8 Sep 92 18:37:45 GMT
- References: <ETNKNA.92Sep7212951@hisoy2.etn.ericsson.se>
- Distribution: comp
- Organization: ABB Automation AB, Vasteras, Sweden
- Lines: 36
-
- In article <ETNKNA.92Sep7212951@hisoy2.etn.ericsson.se> etnkna@hisoy2.etn.ericsson.se (Aksnes Knut-Havard) writes:
- >
- >...
- >
- >ARM Section 10.11c suggest a renaming mechanism to be used when two
- >class hierarchies are merged by a common derived class, where the same
- >name is used in both hierarchies, but with different semantics.
- >
- >Such a renaming scheme is of interest in another situation too;
- >sometimes you want to inherit the same class twice, the classical
- >example is an implementation of a sparse matrix using linked lists,
- >each element shall be in one row list and one column list. Deriving
- >linked list twice is not allowed; There are no way to access the
- >members of the two parent classes in a unambiguous way.
- >
-
- A relevant question to ask here is whether a matrix *is* two lists or
- *contains* two lists. I would answer it consists of two list, i.e. we
- have an aggregate relationship rather than a subtype ditto.
-
- >A kludge around this problem is to generate a dummy class inherited
- >from the parent class and derive both the parent class and the dummy.
- >The problem with this kludge is that it clobbers the global name
- >space.
- >
-
- Why not simply have two members of type list?
-
-
-
-
- --
- ---------------------------------------------------------------------------
- Daniel Larsson Email: dlarsson@aut.abb.se
- ABB Automation AB Telefax: +46 21 34 25 25
- V{ster}s, Sweden Telephone: +46 21 34 30 29
-