mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
31 lines
414 B
D
31 lines
414 B
D
struct MyTuple {
|
|
string s;
|
|
}
|
|
|
|
inout(string) myfront(inout(string)[] a)
|
|
{
|
|
return a[0];
|
|
}
|
|
|
|
MyTuple[] myarray(MyZip r)
|
|
{
|
|
MyTuple[] result;
|
|
foreach (e; r)
|
|
result ~= e;
|
|
return result;
|
|
}
|
|
|
|
struct MyZip
|
|
{
|
|
bool empty = false;
|
|
MyTuple front()
|
|
{
|
|
return MyTuple([""].myfront);
|
|
}
|
|
void popFront()
|
|
{
|
|
empty = true;
|
|
}
|
|
}
|
|
|
|
static foreach(t; MyZip().myarray) {}
|