← Back to index
|
Original Bugzilla link
Bug 11129 – multiSort doesn't work with std.container.Array
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-27T02:36:25Z
Last change time
2017-10-03T07:27:58Z
Assigned to
No Owner
Creator
Artem Tarasov
Comments
Comment #0
by lomereiter — 2013-09-27T02:36:25Z
import std.container, std.algorithm; void main() { auto a = Array!int(1, 2, 3); multiSort!("a < b", "a < b")(a[]); } Output of DMD 2.063: ...algorithm.d(8244): Error: template std.algorithm.partition3 does not match any function template declaration. Candidates are: ...algorithm.d(7815): std.algorithm.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)) ...algorithm.d(8244): Error: template std.algorithm.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)) cannot deduce template function from argument types !("a < b", cast(SwapStrategy)0)(Range, int) ...algorithm.d(8244): Error: template instance partition3!("a < b", cast(SwapStrategy)0) errors instantiating template test.d(4): Error: template instance std.algorithm.multiSort!("a < b", "a < b").multiSort!(Range) error instantiating
Comment #1
by monarchdodra — 2013-09-27T03:58:21Z
Looks like an "hasAssignable" vs "hasSwapable" issue. On it.
Comment #2
by razvan.nitu1305 — 2017-10-03T07:27:58Z
Cannot reproduce on Ubuntu 16.04 64-bit, development branch git HEAD. Closing as WORKSFORME.