std.algorithm: Fix the hasAssignableElements restriction from HeapSort

This restriction seems unnecessary (as HeapSortImpl uses swap/swapAt,
which does not require assignability), and was getting in the way of
e.g. sorting a range of Refs. The range can satisfy either
hasAssignableElements, or hasSwappableElements
This commit is contained in:
Vladimir Panteleev 2014-01-14 14:36:27 +00:00
parent d81d540c3e
commit 2e317d0c5d

View file

@ -9466,7 +9466,7 @@ private template HeapSortImpl(alias less, Range)
{
static assert(isRandomAccessRange!Range);
static assert(hasLength!Range);
static assert(hasAssignableElements!Range);
static assert(hasSwappableElements!Range || hasAssignableElements!Range);
alias binaryFun!less lessFun;