← Back to index
|
Original Bugzilla link
Bug 12861 – std.algorithm.sort of core.simd.int4[] too
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-06-05T22:51:31Z
Last change time
2020-03-21T03:56:34Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2014-06-05T22:51:31Z
void main() { import core.simd: int4; import std.algorithm: sort, SwapStrategy; int4[] data = [[1, 2, 3, 4], [10, 20, 30, 40]]; data.sort!q{ a.array < b.array }; data.sort!(q{ a.array < b.array }, SwapStrategy.stable); } DMD 2.066alpha gives: ...\dmd2\src\phobos\std\range.d(2224,36): Error: cannot implicitly convert expression (val) of type int[4] to __vector(int[4]) ...\dmd2\src\phobos\std\range.d(2281,39): Error: cannot implicitly convert expression (val) of type int[4] to __vector(int[4]) ...\dmd2\src\phobos\std\range.d(2308,42): Error: cannot implicitly convert expression (val) of type int[4] to __vector(int[4]) ...\dmd2\src\phobos\std\range.d(8385,33): Error: template instance std.range.stride!(__vector(int[4])[]) error instantiating ...\dmd2\src\phobos\std\algorithm.d(9364,1): instantiated from here: SortedRange!(__vector(int[4])[], " a.array < b.array ") test2.d(5,9): instantiated from here: sort!(" a.array < b.array ", cast(SwapStrategy)0, __vector(int[4])[]) ...\dmd2\src\phobos\std\algorithm.d(9395,29): Error: template instance std.range.assumeSorted!(" a.array < b.array ", __vector(int[4])[]) error instantiating test2.d(5,9): instantiated from here: sort!(" a.array < b.array ", cast(SwapStrategy)0, __vector(int[4])[]) ...\dmd2\src\phobos\std\range.d(7793,17): Error: cannot implicitly convert expression (r[i]) of type __vector(int[4]) to int[4] ...\dmd2\src\phobos\std\algorithm.d(10004,28): Error: template instance std.range.moveAt!(__vector(int[4])[], uint) error instantiating ...\dmd2\src\phobos\std\algorithm.d(9386,13): instantiated from here: TimSortImpl!(binaryFun, __vector(int[4])[]) test2.d(6,9): instantiated from here: sort!(" a.array < b.array ", cast(SwapStrategy)2, __vector(int[4])[]) ...\dmd2\src\phobos\std\algorithm.d(10020,32): Error: cannot implicitly convert expression (move(item)) of type int[4] to __vector(int[4]) ...\dmd2\src\phobos\std\algorithm.d(9982,22): Error: function std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).lessEqual (int[4] a, int[4] b) is not callable using argument types (__vector(int[4]), __vector(int[4])) ...\dmd2\src\phobos\std\algorithm.d(9984,49): Error: function std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).lessEqual (int[4] a, int[4] b) is not callable using argument types (__vector(int[4]), __vector(int[4])) ...\dmd2\src\phobos\std\algorithm.d(9988,47): Error: function std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).greater (int[4] a, int[4] b) is not callable using argument types (__vector(int[4]), __vector(int[4])) ...\dmd2\src\phobos\std\algorithm.d(10061,52): Error: template std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).gallopSearch!(false, true).gallopSearch cannot deduce function from argument types !()(__vector(int[4])[], __vector(int[4])), candidates are: ...\dmd2\src\phobos\std\algorithm.d(10288,16): std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).gallopSearch!(false, true).gallopSearch(R)(R range, T value) ...\dmd2\src\phobos\std\algorithm.d(10062,52): Error: template std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).gallopSearch!(true, false).gallopSearch cannot deduce function from argument types !()(__vector(int[4])[], __vector(int[4])), candidates are: ...\dmd2\src\phobos\std\algorithm.d(10288,16): std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).gallopSearch!(true, false).gallopSearch(R)(R range, T value) ...\dmd2\src\phobos\std\algorithm.d(7824,37): Error: cannot implicitly convert expression (source[idx]) of type __vector(int[4]) to int[] ...\dmd2\src\phobos\std\algorithm.d(10115,13): Error: template instance std.algorithm.copy!(__vector(int[4])[], int[4][]) error instantiating ...\dmd2\src\phobos\std\algorithm.d(9386,13): instantiated from here: TimSortImpl!(binaryFun, __vector(int[4])[]) test2.d(6,9): instantiated from here: sort!(" a.array < b.array ", cast(SwapStrategy)2, __vector(int[4])[]) ...\dmd2\src\phobos\std\algorithm.d(10133,30): Error: function std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).lessEqual (int[4] a, int[4] b) is not callable using argument types (int[4], __vector(int[4])) ...\dmd2\src\phobos\std\algorithm.d(10135,38): Error: cannot implicitly convert expression (temp[lef++]) of type int[4] to __vector(int[4]) ...\dmd2\src\phobos\std\algorithm.d(10152,47): Error: template std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).gallopSearch!(false, true).gallopSearch cannot deduce function from argument types !()(int[4][], __vector(int[4])), candidates are: ...\dmd2\src\phobos\std\algorithm.d(10288,16): std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).gallopSearch!(false, true).gallopSearch(R)(R range, T value) ...\dmd2\src\phobos\std\algorithm.d(10153,62): Error: cannot implicitly convert expression (temp[lef++]) of type int[4] to __vector(int[4]) ...\dmd2\src\phobos\std\algorithm.d(10334,29): Error: function std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).greater (int[4] a, int[4] b) is not callable using argument types (int[4], __vector(int[4])) ...\dmd2\src\phobos\std\algorithm.d(10350,29): Error: function std.algorithm.TimSortImpl!(binaryFun, __vector(int[4])[]).greater (int[4] a, int[4] b) is not callable using argument types (int[4], __vector(int[4]))
Comment #1
by b2.temp — 2015-11-21T14:03:28Z
2.069 ok