simple multiset question
From: John Harrison (john_andronicus_at_hotmail.com)
Date: 08/04/04
- Next message: John Harrison: "Re: too much globals?"
- Previous message: Gernot Frisch: "too much globals?"
- Next in thread: Ali Cehreli: "Re: simple multiset question"
- Reply: Ali Cehreli: "Re: simple multiset question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 04 Aug 2004 07:57:18 +0100
If you insert equal values into a multiset is it specified what order they
will have in the multiset. For instance, what should be the output of this
program, is it defined?
#include <set>
#include <iostream>
int main()
{
std::multiset<int> m;
m.insert(1);
std::multiset<int>::iterator i = m.insert(1);
if (i == m.begin())
std::cout << "before\n";
else
std::cout << "after\n";
}
FWIW I tested this on two compilers and got "after" both times but I can't
see this issue addressed in the standard anywhere.
john
- Next message: John Harrison: "Re: too much globals?"
- Previous message: Gernot Frisch: "too much globals?"
- Next in thread: Ali Cehreli: "Re: simple multiset question"
- Reply: Ali Cehreli: "Re: simple multiset question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]