[Issue 7666] A function to reverse the items of a tuple
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Oct 27 15:59:05 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7666
timon.gehr at gmx.ch changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |timon.gehr at gmx.ch
--- Comment #2 from timon.gehr at gmx.ch 2012-10-27 15:59:04 PDT ---
(In reply to comment #1)
> ...
>
> If there is a non-invasive way of doing this it would be welcome.
import std.typecons, std.conv, std.range, std.algorithm;
auto reversed(T)(T t) if(isTuple!T){
return
mixin(`tuple(`~iota(T.length).retro.map!(a=>text("t[",a,"]")).join(",")~`)`);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list