[Issue 15530] New: multiSort forbids any SwapStrategy different fron unstable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jan 8 12:57:47 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15530

          Issue ID: 15530
           Summary: multiSort forbids any SwapStrategy different fron
                    unstable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: temtaime at gmail.com

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

--


More information about the Digitalmars-d-bugs mailing list