J
John Harrison
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
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