home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / fj / lang / c / 604 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.4 KB  |  50 lines

  1. Newsgroups: fj.lang.c
  2. Path: sparky!uunet!ccut!news.u-tokyo.ac.jp!wnoc-tyo-news!jingw!info-jindai!s905571
  3. From: s905571@educ.info.kanagawa-u.ac.jp (Yasunari Momoi)
  4. Subject: Is this g++'s bug?
  5. Sender: news@educ.info.kanagawa-u.ac.jp
  6. Organization: Faculty of Science , Kanagawa Univ., Kanagawa, Japan.
  7. Date: Thu, 28 Jan 1993 09:32:39 GMT
  8. Message-ID: <S905571.93Jan28183238@purple.educ.info.kanagawa-u.ac.jp>
  9. Lines: 38
  10. Distribution: fj
  11.  
  12. $@Em0f!w?@F`@nBg$G(J$@$9!#(J
  13.  
  14. g++ ver. 2.3.3 $@$r;H$C$F$$$?$i!"$3$s$J%P%0!J!)!K$KAx6x$7$^$7$?!#(J
  15. -----
  16. template <class T>
  17. inline void swap(T& a, T& b)
  18. {
  19.     T t = a;
  20.     a = b;
  21.     b = t;
  22. }
  23. -----
  24. $@$H$$$&4X?t$J$N$G$9$,!"2<$N%=!<%9%3!<%I$r%3(J$@%s%Q%$%k$9$k$H!"(J
  25. -----
  26. class Foo {
  27.     double a;
  28.     public:
  29.     double& operator () () { return a; }
  30. };
  31.  
  32. int main()
  33. {
  34.     Foo a, b;
  35.     swap(a(), b());
  36.     return 0;
  37. }
  38. -----
  39. -----
  40. bad argument 0 for function `swap (double &&, double &&)' (type was double &)
  41. -----
  42. $@$3$N$h$&$J%(%i!<$r=P$7$F;_$^$C$F$7$^$$$^$9!#(J
  43. $@3N$+$K!V(J$@=c?h$K!W7?$r9g$o$;$l$P$3$&$J$k$N$+$bCN$l$^$;$s$,!"(J
  44. Borland C++ $@$G$O$3$N$h$&$J$3$H$O$"$j$^$;$s!#$I$A$i(J$@$,$?$@$7$$$N$G$7$g$&$+!)(J
  45. --
  46. -------------------------------------------------------------------------
  47. # What do you look at me,          | $@?@F`@nBg3XM}3XIt>pJs2J3X2J(J3$@G/(J
  48. #                                  |           $@Em0f(J $@9/@.(J (Yasunari Momoi)
  49. #                when you hate me? | (s905571@educ.info.kanagawa-u.ac.jp)
  50.