Deprecation: std.container.array.RangeT(A) is not visible from module Size

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 8 16:48:14 PDT 2017


On 09/08/2017 11:21 AM, Vino.B wrote:

 > One final help on how to print the below
 > output , just in case if this issue is fixed in next release,
 >
 > Output:
 > [Tuple!string("C:\\Temp\\sapnas2\\BACKUP\\dir1"),
 > Tuple!string("C:\\Temp\\sapnas2\\BACKUP\\DND5")][34, 4]
 >
 > Required output:
 > C:\\Temp\\sapnas2\\BACKUP\\dir1                 34
 > C:\\Temp\\sapnas2\\BACKUP\\DND5                  4

std.algorithm.zip can help:

void main () {
     auto results = coSizeDirList();
     auto dirs = results[][0];            // A range
     auto sizes = results[][1];           // Another range
     auto combined = zip(dirs, sizes);    // Corresponding elements linked

     foreach (result; combined) {
         auto dir = result[0];     // The element from the first range
         auto size = result[1];    // The element from the second range
         writefln("%-40s %20s", dir, size);
     }
}

Ali



More information about the Digitalmars-d-learn mailing list