home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15860 < prev    next >
Encoding:
Internet Message Format  |  1992-11-07  |  838 b 

  1. Path: sparky!uunet!ogicse!emory!sol.ctr.columbia.edu!ira.uka.de!chx400!bernina!haechler
  2. From: haechler@bernina.ethz.ch (Stefan Haechler)
  3. Newsgroups: comp.lang.c++
  4. Subject: member test?
  5. Message-ID: <1992Nov6.081658.29693@bernina.ethz.ch>
  6. Date: 6 Nov 92 08:16:58 GMT
  7. Article-I.D.: bernina.1992Nov6.081658.29693
  8. Sender: news@bernina.ethz.ch (USENET News System)
  9. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  10. Lines: 27
  11. X-Newsreader: Tin 1.1 PL5
  12.  
  13. How can I know which dynamic type has a variable ?
  14.  
  15. e.g.
  16.  
  17. class A { .... } ;
  18. class B: public A { ... } ;
  19.  
  20. // variable declaration 
  21.  
  22. A *a ;
  23.  
  24.  
  25. // initialization
  26.  
  27. a = new B;
  28.  
  29. // now the dynamic type of "a" is B
  30.  
  31. // my question:
  32. // is there a statement for testing if a is member of B
  33. // e.g 
  34.   if (member(a,B) == true) ..... else ..... ;
  35.  
  36.  
  37. thanks and  best regards
  38.  
  39. wolfgang
  40.