home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13563 < prev    next >
Encoding:
Text File  |  1992-09-12  |  1.3 KB  |  33 lines

  1. Path: sparky!uunet!usc!wupost!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!rpi!bu.edu!att!att!allegra!alice!ark
  2. From: ark@alice.att.com (Andrew Koenig)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: zero-length datatype
  5. Message-ID: <23658@alice.att.com>
  6. Date: 12 Sep 92 15:51:36 GMT
  7. References: <TMB.92Sep8141523@arolla.idiap.ch> <4947@holden.lulea.trab.se> <HAYDENS.92Sep9215705@bullwinkle.juliet.ll.mit.edu> <TMB.92Sep10120206@arolla.idiap.ch> <23650@alice.att.com> <TMB.92Sep11211332@arolla.idiap.ch>
  8. Reply-To: ark@alice.UUCP ()
  9. Distribution: comp
  10. Organization: AT&T Bell Laboratories, Murray Hill NJ
  11. Lines: 20
  12.  
  13. In article <TMB.92Sep11211332@arolla.idiap.ch> tmb@idiap.ch writes:
  14.  
  15. > To remain compatible with C, you can interpret the above prototype as
  16. > meaning either "a function taking no arguments" or as "a function
  17. > taking exactly one argument of type 'void'". That is, it would be
  18. > legal to call the above function as "f()" or "f(void())". Since there
  19. > is no actual data being passed and no actual dereferencing happening,
  20. > this is harmless.
  21.  
  22. No it's not harmless.  For example, consider overloading:
  23.  
  24.     extern void f();
  25.     extern void f(T);
  26.  
  27. If T happens to be void, is this just a redeclaration of the same f?
  28. I'm presuming that I want to be able to define f without knowing the
  29. identity of type T.
  30. -- 
  31.                 --Andrew Koenig
  32.                   ark@europa.att.com
  33.