www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13551] New: std.conv.to for std.typecons tuples too


          Issue ID: 13551
           Summary: std.conv.to for std.typecons tuples too
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

I suggest to support the conversion to tuples too:

void main() {
    import std.conv: to;
    import std.typecons: Tuple;
    auto data = ["10", "20", "30"];
    auto a3 = data.to!(int[3]);                // OK
    auto t3 = data.to!(Tuple!(int, int, int)); // Error
    // An usage example:
    //static void foo(int x, int y, int z) {}
    //foo(data.to!(Tuple!(int, int, int))[]);

Sep 28 2014