home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cs.utexas.edu!lgc.com!srinivas
- From: srinivas@lgc.com (Manapragada Srinivas)
- Subject: Overloading in the presence of ellipsis
- Message-ID: <1992Aug27.164855.17882@lgc.com>
- Sender: usenet@lgc.com
- Nntp-Posting-Host: squirt.lgc.com
- Organization: Landmark Graphics Corporation
- References: <1992Aug22.122940.12580@lut.ac.uk> <1992Aug27.115621.23359@lut.ac.uk>
- Date: Thu, 27 Aug 1992 16:48:55 GMT
- Lines: 32
-
-
- Hi,
-
- If I overload a function in the following way
-
- foo( int ) { cout << "non ellipsis version" << endl; }
-
- foo( int ... ) { cout << "ellipsis version" << endl; }
-
- main() { foo(1); }
-
-
- The CC 2.0 on sun complains about finding an exact match for 'foo' and
- aborts.
-
- g++2.2.2 on the other hand doesn't complain even with the -Wall flag,
- and on running the executable prints out
-
- "non ellipsis version"
-
- which is the behaviour I would expect.
-
-
- Unfortunately, ARM (page 326) explicitly states that this is an error.
-
- The problem I am having is that the g++ behaviour is what I am looking
- for, does anyone know what the ANSI committee adopted?
-
- Thanks in advance,
- Srinivas
- --
- Yonder, beyond the event horizon!
-