[Issue 13837] New: Named tuples with type inference

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Dec 8 14:22:54 PST 2014


https://issues.dlang.org/show_bug.cgi?id=13837

          Issue ID: 13837
           Summary: Named tuples with type inference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: peter.alexander.au at gmail.com

Currently, you can name tuple parameters if you specify the types and names.

alias Coord = Tuple!(float, "x", float, "y", float, "z");
auto c = Coord(1.0f, 2.0f, 3.0f);

would be nice to be able to do:

auto c = tuple!("x", "y", "z")(1.0f, 2.0f, 3.0f);

and have the types inferred.

--


More information about the Digitalmars-d-bugs mailing list