Bug 11475 – std.algorithm.multiSort.release or similar
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-08T11:34:44Z
Last change time
2018-02-10T22:34:15Z
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-11-08T11:34:44Z
I suggest to add to multiSort the release, to allow the usage of multiSort in UFCS chains.
See also issue 10777
Comment #1 by greensunny12 — 2018-02-10T22:33:53Z
This works since 2.072:
Up to 2.071.2: Failure with output: onlineapp.d(12): Error: no property 'release' for type 'void'
Since 2.072.2: Success with output: [Point(0, 0), Point(0, 1), Point(0, 2), Point(5, 5)]
---
import std.algorithm, std.stdio;
void main()
{
static struct Point
{
int x, y;
}
auto pts1 = [Point(0, 0), Point(5, 5), Point(0, 1), Point(0, 2)];
multiSort!("a.x < b.x", "a.y < b.y", SwapStrategy.unstable)(pts1).release.writeln;
}
---
https://run.dlang.io/is/MQrUn1