I've seen in stackoverflow, people write lambda like this:
int main() {
auto f1 = +[](){};
auto f2 = [](){};
return 0;
}
(1) What does the +
acturelly do in f1
expression?
I tried to add capture, then f1
doesn't compile, but the error is not readable to me:
auto f1 = +[=](){}; // fail to compile
auto f2 = [=](){};
The error is:
invalid argument type '(lambda at .\xxx.cpp:4:16)' to unary expression
auto f1 = +[=](){};
(2) What does this error indicate?
Thanks.