]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/runnable/imports/linktypeinfo_file.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / runnable / imports / linktypeinfo_file.d
1 module imports.linktypeinfo_file;
2
3 auto filter(alias pred, R)(R r)
4 {
5 return FilterResult!(pred, R)(r);
6 }
7
8 struct FilterResult(alias pred, R)
9 {
10 R r;
11 bool empty() { return r.empty; }
12 auto front() { return r.front; }
13 void popFront()
14 {
15 while (!r.empty && pred(r.front))
16 r.popFront();
17 }
18 }
19
20 struct DirIterator
21 {
22 int[] r;
23 @property bool empty() { return r.length == 0; }
24 @property auto front() { return r[0]; }
25 void popFront() { r = r[1..$]; }
26
27 }
28
29 auto dirEntries(string path)
30 {
31 bool f(int de) { return 1; }
32 return filter!f(DirIterator());
33 }