【发布时间】:2013-03-27 05:56:02
【问题描述】:
我正在为 x86 使用 DMD 2.062。
module test;
private enum test1
{
one,
two,
three,
}
private enum test2
{
one,
two,
three,
}
auto ct = cartesianProduct([EnumMembers!test1], [EnumMembers!test2]);
unittest
{
import std.stdio;
foreach (n, m; ct)
{
writeln(n, " ", m);
}
}
这个程序打印出来:
one one
two one
three one
然后抛出访问冲突错误。我是否错误地使用了笛卡尔产品,或者这是函数中的错误?
【问题讨论】: