[Issue 19337] Cannot call std.algorithm.sort twice
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 27 23:01:28 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19337
Nicholas Wilson <iamthewilsonator at hotmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |iamthewilsonator at hotmail.co
| |m
--- Comment #2 from Nicholas Wilson <iamthewilsonator at hotmail.com> ---
Looks like something like
https://github.com/dlang/phobos/blob/master/std/complex.d#L656 would help here.
/* Makes Complex!(Complex!T) fold to Complex!T.
The rationale for this is that just like the real line is a
subspace of the complex plane, the complex plane is a subspace
of itself. Example of usage:
---
Complex!T addI(T)(T x)
{
return x + Complex!T(0.0, 1.0);
}
---
The above will work if T is both real and complex.
*/
template Complex(T)
if (is(T R == Complex!R))
{
alias Complex = T;
}
--
More information about the Digitalmars-d-bugs
mailing list