home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12706 < prev    next >
Encoding:
Text File  |  1992-08-20  |  1.9 KB  |  44 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mole-end!mat
  3. From: mat@mole-end.matawan.nj.us
  4. Subject: Re: Covariant Types in Derived Classes
  5. Message-ID: <1992Aug20.093837.29665@mole-end.matawan.nj.us>
  6. Summary: They are thinking about it ...
  7. Organization: :
  8. References: <1992Aug13.162956.10279@mole-end.matawan.nj.us> <714193217snx@trmphrst.demon.co.uk>
  9. Date: Thu, 20 Aug 1992 09:38:37 GMT
  10. Lines: 32
  11.  
  12. In article <714193217snx@trmphrst.demon.co.uk>, nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
  13. > In article <1992Aug13.162956.10279@mole-end.matawan.nj.us> mat@mole-end.matawan.nj.us writes:
  14. > > In article <713504630snx@trmphrst.demon.co.uk>, nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
  15.  
  16. > > Why do you want a warning?  You asked for it explicitly and it lies
  17. > > within the type system.  ...
  18.  
  19. > You are quite right. In this case, it is legal to write
  20. > x = z;        // Give me a warning please
  21. > x = (int)z;    // I really mean it, don't warn me
  22.  
  23. > However, there are many cases where the cast syntax is _necessary_ ...  To
  24. > have the compiler accept all such casts without warning (because cast means
  25. > "I really mean it") is unfortunate - I might have typed the wrong thing.
  26.  
  27. > I think what I am asking for is some kind of language syntax which
  28. > distinguishes between casts which I expect to be safe [conversions] (so I
  29. > hope the compiler will warn me if they aren't), and those which I know
  30. > aren't safe [coercions] (but I want to do it anyway, ...
  31.  
  32. > What does the team think ?
  33.  
  34. This is your lucky day!  (Well, OK, it's coming in '94 or '95 ...)  The
  35. issue arose in Toronto as a side-effect of RTTI.  Look for a possible
  36. solution in the RTTI stuff that will make it into the literature in the
  37. fall.  (Notice, I'm not promising that there will *be* one; I'm just
  38. telling you to *look* for it ...)
  39. -- 
  40.  (This man's opinions are his own.)
  41.  From mole-end                Mark Terribile
  42.  
  43.  mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
  44.