mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 07:00:37 +03:00
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:
parent
d81d540c3e
commit
2e317d0c5d
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue