c++ lambda function with default capture type

Viewed 39

I am new in c++11 and 14, and I am wondering why in this case

auto c1 = (bool (*)(int))[](int y) {
    return y%2 == 0;
};

the conversion is successful, but when the lambda function has the default capture type, then the conversion fails?

auto c1 = (bool (*)(int))[=](int y) {
    return y%2 == 0;
};
0 Answers
Related