mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
25 lines
399 B
D
25 lines
399 B
D
// REQUIRED_ARGS: -preview=dip1000
|
|
// https://github.com/dlang/dmd/pull/9383
|
|
|
|
void test() @safe
|
|
{
|
|
int[1] a = [1];
|
|
cartesianProduct(a[]);
|
|
}
|
|
|
|
auto cartesianProduct(RR...)(RR ranges)
|
|
{
|
|
static struct Result
|
|
{
|
|
RR current;
|
|
|
|
void popFront() scope @safe
|
|
{
|
|
foreach (ref r; current)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
return Result(ranges);
|
|
}
|