D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15530 - multiSort forbids any SwapStrategy different from unstable
Summary: multiSort forbids any SwapStrategy different from unstable
Status: RESOLVED DUPLICATE of issue 12972
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2016-01-08 20:57 UTC by Temtaime
Modified: 2022-09-19 07:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Temtaime 2016-01-08 20:57:47 UTC
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 Dlang Bot 2022-09-16 13:56:59 UTC
@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 RazvanN 2022-09-19 07:25:46 UTC

*** This issue has been marked as a duplicate of issue 12972 ***