utils: forbid the use of std::less on pointers in TopoSort

This commit is contained in:
Emil J. Tywoniak 2026-04-06 15:03:29 +02:00
parent 2033df5958
commit 41b41fefb3
1 changed files with 2 additions and 0 deletions

View File

@ -131,6 +131,8 @@ public:
template <typename T, typename C = std::less<T>> class TopoSort
{
static_assert(!(std::is_pointer<T>::value && std::is_same<C, std::less<T>>::value),
"std::less is run-to-run unstable for pointers");
public:
// We use this ordering of the edges in the adjacency matrix for
// exact compatibility with an older implementation.