Bug 15530 – multiSort forbids any SwapStrategy different from unstable

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-08T20:57:47Z
Last change time
2022-09-19T07:25:46Z
Keywords
pull
Assigned to
No Owner
Creator
Temtaime

Comments

Comment #0 by temtaime — 2016-01-08T20:57:47Z
import std.algorithm; void main() { int[] arr; arr.multiSort!((a, b) => a < b, (a, b) => a < b, SwapStrategy.stable); } Compilation output: /opt/compilers/dmd2/include/std/algorithm/sorting.d(782): Error: template std.algorithm.sorting.partition3 cannot deduce function from argument types !((a, b) => a < b, cast(SwapStrategy)2)(int[], int), candidates are: /opt/compilers/dmd2/include/std/algorithm/sorting.d(504): std.algorithm.sorting.partition3(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, E)(Range r, E pivot) if (ss == SwapStrategy.unstable && isRandomAccessRange!Range && hasSwappableElements!Range && hasLength!Range && is(typeof(binaryFun!less(r.front, pivot)) == bool) && is(typeof(binaryFun!less(pivot, r.front)) == bool) && is(typeof(binaryFun!less(r.front, r.front)) == bool)) /d986/f960.d(6): Error: template instance f960.main.multiSort!((a, b) => a < b, (a, b) => a < b, cast(SwapStrategy)2).multiSort!(int[]) error instantiating
Comment #1 by dlang-bot — 2022-09-16T13:56:59Z
@jamesragray created dlang/phobos pull request #8569 "Fix issue 15530: multiSort forbids any SwapStrategy different from un…" fixing this issue: - Fix issue 15530: multiSort forbids any SwapStrategy different from unstable. https://github.com/dlang/phobos/pull/8569
Comment #2 by razvan.nitu1305 — 2022-09-19T07:25:46Z
*** This issue has been marked as a duplicate of issue 12972 ***