From: Hicham Mouline on
Hello,

In [alg.unique] 25.3.9 p884, I see the 2 versions of the unique function
accepts 2 arguments of type ForwardIterator.
However, in the Effects section, the conditions described are that:

*(i-1) == *i or pred(*(i-1), *i) != false

Am I misreading or is there an inconsistency?

Regards,


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Howard Hinnant on
On Apr 11, 6:20 pm, "Hicham Mouline" <hic...(a)mouline.org> wrote:
> Hello,
>
> In [alg.unique] 25.3.9 p884, I see the 2 versions of the unique function
> accepts 2 arguments of type ForwardIterator.
> However, in the Effects section, the conditions described are that:
>
> *(i-1) == *i or pred(*(i-1), *i) != false
>
> Am I misreading or is there an inconsistency?

There is no inconsistency. See 25.1 [algorithms.general], p12.

-Howard


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Pete Becker on
Hicham Mouline wrote:
> Hello,
>
> In [alg.unique] 25.3.9 p884, I see the 2 versions of the unique function
> accepts 2 arguments of type ForwardIterator.
> However, in the Effects section, the conditions described are that:
>
> *(i-1) == *i or pred(*(i-1), *i) != false
>
> Am I misreading or is there an inconsistency?
>

Neither. Just being too picky. <g> It would be possible to clutter that code to make it compilable but less readable. But anyone who reads it as it is knows what it means.

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of
"The Standard C++ Library Extensions: a Tutorial and Reference"
(www.petebecker.com/tr1book)

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]