home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 7853 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.2 KB

  1. Path: sparky!uunet!utcsri!sys.toronto.edu!byu
  2. Newsgroups: comp.os.os2.programmer
  3. From: byu@sys.toronto.edu (Benjamin Yu)
  4. Subject: Re: emx/gcc very forgiving!!
  5. Message-ID: <1993Jan21.102941.16328@jarvis.csri.toronto.edu>
  6. Organization: University of Toronto
  7. References: <1993Jan19.140346.4351@jarvis.csri.toronto.edu> <1993Jan20.045839.25052@netcom.com> <1993Jan20.102705.23327@jarvis.csri.toronto.edu> <1jkjleINNfn9@gap.caltech.edu>
  8. Date: 21 Jan 93 15:29:42 GMT
  9. Lines: 24
  10.  
  11. In article <1jkjleINNfn9@gap.caltech.edu> brooke@cco.caltech.edu (Brooke Paul Anderson) writes:
  12. >byu@sys.toronto.edu (Benjamin Yu) writes:
  13. >
  14. >
  15. >>Here goes:
  16. >>class elevator {
  17. >>  int floor_selected;
  18. >>  int floor_number;
  19. >>public:
  20. >>  elevator() { floor_selected = 0; floor_number = 0;} ;
  21. >>  elevator(int x = 10, int y = 10) { floor_selected = x; floor_number = y; };
  22. >>};
  23. >
  24. ...
  25. >
  26. >If it gives you a warning, I'd say that's good enough.  Also, your
  27. >overloaded function doesn't look ambiguous at all to me.  One takes two
  28. >ints as arguments; the other takes no arguments.
  29. >
  30.  
  31. The first definition requires no argument.  The second definition allows
  32. 0, 1, or 2 arguments.  Thus it is ambiguous with the first definition.
  33.  
  34. Ben
  35.