I've encountered a serious behavioral breakage for code using flat_xxx in
conjunction with ordered_unique_range and a non-default comparator in 1.59.0b1.
Here is a small repro:
#include
#include <algorithm>
#include <functional>
#include <iterator>
#include <iostream>
#include
int main()
{
namespace bcont = boost::container;
auto const p = [](auto const& desc, auto const& s)
{
std::cout << desc << ": ";
std::copy(
s.cbegin(), s.cend(),
std::ostream_iterator<int>(std::cout, " ")
);
std::cout << '\n';
};
auto const r = {4, 3, 2};
bcont::flat_set const s{3, 2, 1};
p("orig set", s);
auto s1{s};
s1.insert(r.begin(), r.end());
p("without\tordered_unique_range (expected output)", s1);
auto s2{s};
s2.insert(bcont::ordered_unique_range, r.begin(), r.end());
p("with\tordered_unique_range (erroneous output)", s2);
}
I've worked around this locally by rerouting the ordered_unique_range codepath
to the default codepath, but this seems like a showstopper for 1.59.0 as the
code's behavior has broken entirely silently.
Regards,
Adam Merz