home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 12976 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.1 KB  |  45 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!lgc.com!srinivas
  3. From: srinivas@lgc.com (Manapragada Srinivas)
  4. Subject: Overloading in the presence of ellipsis
  5. Message-ID: <1992Aug27.164855.17882@lgc.com>
  6. Sender: usenet@lgc.com
  7. Nntp-Posting-Host: squirt.lgc.com
  8. Organization: Landmark Graphics Corporation
  9. References: <1992Aug22.122940.12580@lut.ac.uk> <1992Aug27.115621.23359@lut.ac.uk>
  10. Date: Thu, 27 Aug 1992 16:48:55 GMT
  11. Lines: 32
  12.  
  13.  
  14. Hi,
  15.  
  16.     If I overload a function in the following way
  17.  
  18.         foo( int ) { cout << "non ellipsis version" << endl; }
  19.  
  20.         foo( int ... ) { cout << "ellipsis version" << endl; }
  21.  
  22.         main() { foo(1); }
  23.  
  24.  
  25.     The CC 2.0 on sun complains about finding an exact match for 'foo' and
  26.     aborts.
  27.  
  28.     g++2.2.2 on the other hand doesn't complain even with the -Wall flag,
  29.     and on running the executable prints out
  30.     
  31.             "non ellipsis version"
  32.  
  33.     which is the behaviour I would expect.
  34.  
  35.  
  36.     Unfortunately, ARM (page 326) explicitly states that this is an error.
  37.  
  38.     The problem I am having is that the g++ behaviour is what I am looking
  39.     for, does anyone know what the ANSI committee adopted?
  40.  
  41. Thanks in advance,
  42. Srinivas
  43. --
  44. Yonder, beyond the event horizon!
  45.