D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12861 - std.algorithm.sort of core.simd.int4[] too
Summary: std.algorithm.sort of core.simd.int4[] too
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2014-06-05 22:51 UTC by bearophile_hugs
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2014-06-05 22:51:31 UTC
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 basile-z 2015-11-21 14:03:28 UTC
2.069 ok