home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: fj.lang.c
- Path: sparky!uunet!ccut!news.u-tokyo.ac.jp!wnoc-tyo-news!jingw!info-jindai!s905571
- From: s905571@educ.info.kanagawa-u.ac.jp (Yasunari Momoi)
- Subject: Is this g++'s bug?
- Sender: news@educ.info.kanagawa-u.ac.jp
- Organization: Faculty of Science , Kanagawa Univ., Kanagawa, Japan.
- Date: Thu, 28 Jan 1993 09:32:39 GMT
- Message-ID: <S905571.93Jan28183238@purple.educ.info.kanagawa-u.ac.jp>
- Lines: 38
- Distribution: fj
-
- $@Em0f!w?@F`@nBg$G(J$@$9!#(J
-
- g++ ver. 2.3.3 $@$r;H$C$F$$$?$i!"$3$s$J%P%0!J!)!K$KAx6x$7$^$7$?!#(J
- -----
- template <class T>
- inline void swap(T& a, T& b)
- {
- T t = a;
- a = b;
- b = t;
- }
- -----
- $@$H$$$&4X?t$J$N$G$9$,!"2<$N%=!<%9%3!<%I$r%3(J$@%s%Q%$%k$9$k$H!"(J
- -----
- class Foo {
- double a;
- public:
- double& operator () () { return a; }
- };
-
- int main()
- {
- Foo a, b;
- swap(a(), b());
- return 0;
- }
- -----
- -----
- bad argument 0 for function `swap (double &&, double &&)' (type was double &)
- -----
- $@$3$N$h$&$J%(%i!<$r=P$7$F;_$^$C$F$7$^$$$^$9!#(J
- $@3N$+$K!V(J$@=c?h$K!W7?$r9g$o$;$l$P$3$&$J$k$N$+$bCN$l$^$;$s$,!"(J
- Borland C++ $@$G$O$3$N$h$&$J$3$H$O$"$j$^$;$s!#$I$A$i(J$@$,$?$@$7$$$N$G$7$g$&$+!)(J
- --
- -------------------------------------------------------------------------
- # What do you look at me, | $@?@F`@nBg3XM}3XIt>pJs2J3X2J(J3$@G/(J
- # | $@Em0f(J $@9/@.(J (Yasunari Momoi)
- # when you hate me? | (s905571@educ.info.kanagawa-u.ac.jp)
-