Topic: Defect Report: upper_bound(first, last, ...) cannot return last
Author: musiphil@bawi.org (Seungbeom Kim)
Date: Wed, 3 May 2006 23:31:17 GMT Raw View
ISO/IEC 14882:2003 says:
25.3.3.2 upper_bound
Returns: The furthermost iterator i in the range [first, last) such that
for any iterator j in the range [first, i) the following corresponding
conditions hold: !(value < *j) or comp(value, *j) == false
>From the description above, upper_bound cannot return last, since it's
not in the interval [first, last). This seems to be a typo, because if
value is greater than or equal to any other values in the range, or if
the range is empty, returning last seems to be the intended behaviour.
The corresponding interval for lower_bound is also [first, last].
Proposed Change: change [first, last) into [first, last].
--
Seungbeom Kim
---
[ 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.comeaucomputing.com/csc/faq.html ]
Author: musiphil@bawi.org (Seungbeom Kim)
Date: Sat, 6 May 2006 17:35:51 GMT Raw View
Seungbeom Kim wrote:
> Defect Report: upper_bound(first, last, ...) cannot return last
>
> ISO/IEC 14882:2003 says:
>
> 25.3.3.2 upper_bound
>
> Returns: The furthermost iterator i in the range [first, last) such that
> for any iterator j in the range [first, i) the following corresponding
> conditions hold: !(value < *j) or comp(value, *j) == false
>
>>From the description above, upper_bound cannot return last, since it's
> not in the interval [first, last). This seems to be a typo, because if
> value is greater than or equal to any other values in the range, or if
> the range is empty, returning last seems to be the intended behaviour.
> The corresponding interval for lower_bound is also [first, last].
>
> Proposed Change: change [first, last) into [first, last].
Why am I not seeing the moderator's note saying
"Forwarded to C++ Committee" for the defect report above?
Is there anything missing to be a valid defect report?
(I would appreciate it very much if I could see a note saying
what was missing in what was definitely meant to be a defect report
to be forwarded to the C++ committee.)
--
Seungbeom Kim
---
[ 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.comeaucomputing.com/csc/faq.html ]
Author: howard.hinnant@gmail.com (Howard Hinnant)
Date: Sun, 7 May 2006 03:44:50 GMT Raw View
In article <e3hmml$bc7$1@news.Stanford.EDU>,
musiphil@bawi.org (Seungbeom Kim) wrote:
> Seungbeom Kim wrote:
> > Defect Report: upper_bound(first, last, ...) cannot return last
> >
> > ISO/IEC 14882:2003 says:
> >
> > 25.3.3.2 upper_bound
> >
> > Returns: The furthermost iterator i in the range [first, last) such that
> > for any iterator j in the range [first, i) the following corresponding
> > conditions hold: !(value < *j) or comp(value, *j) == false
> >
> >>From the description above, upper_bound cannot return last, since it's
> > not in the interval [first, last). This seems to be a typo, because if
> > value is greater than or equal to any other values in the range, or if
> > the range is empty, returning last seems to be the intended behaviour.
> > The corresponding interval for lower_bound is also [first, last].
> >
> > Proposed Change: change [first, last) into [first, last].
>
> Why am I not seeing the moderator's note saying
> "Forwarded to C++ Committee" for the defect report above?
> Is there anything missing to be a valid defect report?
>
> (I would appreciate it very much if I could see a note saying
> what was missing in what was definitely meant to be a defect report
> to be forwarded to the C++ committee.)
I got it. This is now lwg issue 577.
-Howard
Library Working Group Chair
---
[ 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.comeaucomputing.com/csc/faq.html ]