Hi, been looking for a way to convert an array to a tuple, but can't seem to find one. Is there one?

Looking for something like:

alias Point = Tuple!(int, "x", int, "y");
enum data = "1,2:8,9";
auto points = data
  .split(':')
  .map!(a => a
    .split(',')
    .map!(to!int)
  )
.map!Point; // <-- this works if you do `.map!(a => Point(a[0], a[1]));` instead

Cheers!

Reply via email to