BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
Sorting
Collaboration diagram for Sorting:

Files

file  Sort.hpp

Namespaces

namespace  util
namespace  util::sort
namespace  util::sort::detail

Functions

template<typename T, typename Compare>
constexpr void util::sort::portable_sort (const std::span< T > range, Compare comp)

Detailed Description

A sort that gives the same result with every standard library.

Function Documentation

◆ portable_sort()

template<typename T, typename Compare>
void util::sort::portable_sort ( const std::span< T > range,
Compare comp )
constexpr

Sorts the range so that comp(b, a) is false for every a before b.

Like std::sort, this isn't stable. Unlike std::sort, the order it leaves equal elements in is the same with every compiler & standard library, so results that depend on it (like the engine's node counts) are the same on every platform.

Definition at line 179 of file Sort.hpp.