16,472
社区成员
发帖
与我相关
我的任务
分享
class A
{
int a, b;
public:
A():a(5),b(6)
{
}
void Print()
{
while ([this]{
cout<<a<<","<<b<<endl;
return (a++)+(b++)>20;
})
{
}
}
}
class A
{
int a, b;
public:
A():a(5),b(6)
{
}
void Print()
{
auto fun =
[this] () -> bool {
cout<<a<<","<<b<<endl;
return ((a++)+(b++))>20;
};
while (fun())
{
}
}
};
void test()
{
A a;
a.Print();
}
我做了这样的修改,现在编译可以通过,但链接有问题
错误 2 error LNK1169: 找到一个或多个多重定义的符号 F:\Test\console_tests\Debug\for_console.exe 1 1 for_console