Topic: Comments on 1745 (latest TR1)
Author: caj@cs.york.ac.uk (Chris Jefferson)
Date: Tue, 1 Feb 2005 03:18:55 GMT Raw View
Two comments.. sorry if these have been made before.
1) In 6.1.3.5-5, there are (bool) casts in a number of places. This is
related to open defect 484. Can this be taken as a sign that standard
algorithms should cast all calls to things like <, etc?
2) There doesn't seem to be a swap overload for tuple. Is there some
reason why one isn't present? It seems like for pair to be an obvious
thing to have with no obvious problems, but if it will slightly change
behaviour when an attempting at swapping fails part way through, so it
has to really be in the standard from the start.
Chris
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: petebecker@acm.org (Pete Becker)
Date: Tue, 1 Feb 2005 18:34:17 GMT Raw View
Chris Jefferson wrote:
> 1) In 6.1.3.5-5, there are (bool) casts in a number of places. This is
> related to open defect 484. Can this be taken as a sign that standard
> algorithms should cast all calls to things like <, etc?
No. The bool casts in 6.1.3.5/5 aren't strictly necessary. The
comparison operators have to return a result that's convertible to bool.
In most contexts that conversion happens automatically (e.g. "if(a <
b)"). In text that conversion doesn't happen, so the cast is supposed to
make it clearer.
--
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]