[Issue 17818] Deprecation: std.container.array.RangeT(A) is not visiable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 10 15:36:39 UTC 2017


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

Vino <vino.bheeman at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from Vino <vino.bheeman at hotmail.com> ---
Hi Jonathan.

 Thank you very much, as stated by you I used the auto function and now i am
able to get the output without any warnings, but this do not help me in my
overall program, meaning, when I call this sub function  from the main thread
function program it is not working as expected and throwing an error.

Sub Function:

auto coSizeDirList (string FFs, int SizeDir) {
    ulong subdirTotal;
    ulong subdirTotalGB;
    Array!string Subdir;
    Array!ulong Subsize;
    //Tuple!((Array!string), (Array!string)) Result;
    auto dFiles = Array!string ((dirEntries(FFs, SpanMode.shallow).filter!(a =>
a.isDir))[].map!(a => a.name));
    foreach (d; dFiles[]) {
                auto SdFiles = Array!ulong(dirEntries(d, SpanMode.depth).map!(a
=> a.size));
                foreach(f; SdFiles[]) { subdirTotal += f; }
                subdirTotalGB = (subdirTotal/1024/1024); { Subdir ~= d; Subsize
~= subdirTotalGB; }
                if (subdirTotalGB > SizeDir)
                subdirTotal = 0;
            }
            return tuple (Subdir[], Subsize[]);

}

Main Thread function :
void ptSizeDirList (string[] SizeDirlst, int SizeDir) {
 try {
 //Array!string MStext;
 string[][] MStext;     // Getting Error on this line, while trying to change
it to auto;
 auto MSresult = taskPool.workerLocalStorage(MStext);
 logF.writeln("Function \t :  List the Folder whose Size greater then ",
SizeDir, " GB");
 logF.writeln("Dir. Scanned \t :", SizeDirlst);

logF.writeln("************************************************************************************");
 logF.writefln("%-63s %.20s", "File Name", "Size (GB)");

logF.writeln("************************************************************************************");
 foreach (string Fs; parallel(SizeDirlst[0 .. $], 1)) {
            auto FFs = Fs.strip;
            auto MSizeDirList = task(&coSizeDirList, FFs, SizeDir);
            MSizeDirList.executeInNewThread();
            auto MSizeDirListData = MSizeDirList.workForce;
            MSresult.get ~= MSizeDirListData;
        }
        foreach(i; MSresult.toRange)
        if (!i.empty) {
            writefln("%(%-(%-63s %)\n%)", i[].sort!((a,b) => a[0] <
b[0]).uniq); }

writeln("************************************************************************************");
} catch (Exception e) { writeln(e.msg); }
}

void main () {
string SizeDirlst = "C:\\Temp\\sapnas2\\BACKUP";
int SizeDir = 1;

ptSizeDirList(SizeDirlst, SizeDir);
}

Error:
Error: no identifier for declarator MStext
Deprecation: use { } for an empty statement, not ;

So what should i use to the line " string[][] MStext" in my main function and
also, I have another program which return the range and passes the range as a
function argument to another function which throws the same deprecation
warning.

Eg :
auto function1 () {

return tuple(data)  // range array

}

void funciton2(RangeT!(Array!string) data2) {  
string data3 = "Test1";
string data4 = data3 ~ data2;
writeln(data4);
}

void main () {
string data2 = function1[];
funciton2(data2);
}
}
 Deprecation message at line auto funciton2(RangeT!(Array!string) data2).

From,
Vino.B

--


More information about the Digitalmars-d-bugs mailing list