home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!spool.mu.edu!yale.edu!newsserver.jvnc.net!newsserver.technet.sg!nuscc!papaya!suresh
- From: suresh@papaya.iss.nus.sg (Suresh Thennarangam - Research Scholar)
- Subject: Re: Borland C++ Complete?
- Message-ID: <1993Jan21.041855.1950@nuscc.nus.sg>
- Sender: usenet@nuscc.nus.sg
- Organization: Institute Of Systems Science, NUS
- References: <1993Jan15.123610.9073@jarvis.csri.toronto.edu> <1993Jan16.075038.16467@netcom.com> <1993Jan18.094026.24916@jarvis.csri.toronto.edu>
- Date: Thu, 21 Jan 1993 04:18:55 GMT
- Lines: 50
-
- In article <1993Jan18.094026.24916@jarvis.csri.toronto.edu> byu@sys.toronto.edu (Benjamin Yu) writes:
- >In article <1993Jan16.075038.16467@netcom.com> donahn@netcom.com (Don Ahn) writes:
- >>In article <1993Jan15.123610.9073@jarvis.csri.toronto.edu> byu@sys.toronto.edu (Benjamin Yu) writes:
- >>>1) I can't overload a function with default arguments in
- >>>Borland C++. For example:
- >>> void initialize(int X = 0, int Y = 0);
- >>> void initialize();
- >>> Y.initialize(); <<- fails in compile
- >> This is definitely an error, you have no way of knowing
- >> which initialize to call (i.e. do you mean initialize(0,0)
- >> or initialize(void) ? If you look on page 316 of the
- >> Annotated c++ ref. manual, you will see that Stroustrup
- >> agrees.
- >>
- >
- >Hmm, I am not sure which definition I should follow. I don't have ARM but have
- >The C++ Programming Language Second Edition by Stroustrup. On page 588, I quote:
- >
- > "A call of a given function name chooses, from among all functions by that name
- > that are in scope and for which a set of conversions exists so that the
- > function could possibly be called, the function that best matches the
- > actual arguments."
- >
- >It then gives a whole list of conversion rules. So Y.initialize() best matches
- >initialize(void), and that should be called!
-
- Which conversion rule have you applied to draw this conclusion ?
-
- Perhaps [1] Exact match: Sequences of zero or more trivial conversions are
- better than all other sequences. ..........
-
- However in the above case that Benjamin has stated there are no conversions
- required for either candidate(to my knowledge :->). Default arguments does not
- mean that a conversion from void to the type of the formal argument is made.
- Indeed such a conversion is illegal.
-
-
-
- __
- (_ / / o_ o o |_
- __)/(_( __) (_(_ /_)| )_
-
- ***************************************************************************
- * Suresh Thennarangam * EMail: suresh@iss.nus.sg(Internet) *
- * Research Scholar * ISSST@NUSVM.BITNET *
- * Institute Of Systems Science * Tel: (065) 772 2588. *
- * National University Of Singapore * Facs.: (065) 778 2571 *
- * Heng Mui Keng Terrace * Telex: ISSNUS RS 39988 *
- * Singapore 0511. * *
- ***************************************************************************
-