Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

merge algorithm with set and map

2 views
Skip to first unread message

Nikola Smiljanić

unread,
Sep 22, 2008, 8:33:38 PM9/22/08
to
Are there any guarantees about what element will merge algorithm add
to resulting range if there are two that are equal.

Dinkumware implementation always uses element from first source range,
but can I count on this?

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

Zara

unread,
Sep 23, 2008, 9:17:56 PM9/23/08
to
On Mon, 22 Sep 2008 18:33:38 CST, Nikola Smiljani?
<popi...@gmail.com> wrote:

>Are there any guarantees about what element will merge algorithm add
>to resulting range if there are two that are equal.
>
>Dinkumware implementation always uses element from first source range,
>but can I count on this?


std c++, 25.3.4-5 Notes: Stable: for equivalent elements in the two
ranges, the elements from the first range always precede the elements
from the second

Best regards,

Zara

Erik Wikström

unread,
Sep 24, 2008, 9:47:52 AM9/24/08
to
On 2008-09-23 02:33, Nikola Smiljanić wrote:
> Are there any guarantees about what element will merge algorithm add
> to resulting range if there are two that are equal.
>
> Dinkumware implementation always uses element from first source range,
> but can I count on this?


Yes, it is specified in the standard.

--
Erik Wikström

0 new messages