The assertion in the following piece of code fires:
std::list<int> collection;
auto distribution = dist::alternating{};
distribution(std::back_inserter(collection), 10'000);
cppsort::quick_merge_sort(collection, dist::as_long_string{});
assert(std::is_sorted(collection.begin(), collection.end()));
Additional information:
All of the other default distributions of patterns benchmark work correctly
It works correctly without dist::as_long_string
The assertion fires when sorting either an std::list or an std::vector
The third bullet above means that the issue most likely doesn't come from the introselect implementation. Instinctively I would blame the handling of projections in the main body of quick_merge_sort.
Not an algorithmic issue but a brain fart: dist::alternating generates negative numbers, which obviously don't compare properly when converted to strings since the character - wrecks havoc.
The assertion in the following piece of code fires:
Additional information:
dist::as_long_string
std::list
or anstd::vector
The third bullet above means that the issue most likely doesn't come from the introselect implementation. Instinctively I would blame the handling of projections in the main body of
quick_merge_sort
.