home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!emory!sol.ctr.columbia.edu!ira.uka.de!chx400!bernina!haechler
- From: haechler@bernina.ethz.ch (Stefan Haechler)
- Newsgroups: comp.lang.c++
- Subject: member test?
- Message-ID: <1992Nov6.081658.29693@bernina.ethz.ch>
- Date: 6 Nov 92 08:16:58 GMT
- Article-I.D.: bernina.1992Nov6.081658.29693
- Sender: news@bernina.ethz.ch (USENET News System)
- Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
- Lines: 27
- X-Newsreader: Tin 1.1 PL5
-
- How can I know which dynamic type has a variable ?
-
- e.g.
-
- class A { .... } ;
- class B: public A { ... } ;
-
- // variable declaration
-
- A *a ;
-
-
- // initialization
-
- a = new B;
-
- // now the dynamic type of "a" is B
-
- // my question:
- // is there a statement for testing if a is member of B
- // e.g
- if (member(a,B) == true) ..... else ..... ;
-
-
- thanks and best regards
-
- wolfgang
-