-2
이 코드가 유효하지 않은 이유는 무엇입니까? 나는 lambda sintax를 올바르게 사용하고 있는지 모르지만 다른 게시물을 기반으로하면 괜찮아 보입니다.정적 함수에서 람다 함수를 사용하려고 시도했습니다 (C++)
struct foo{
static int faa(int x);
};
int foo::faa(int x){
bool isCon = []() {
return true;
};
return isCon();
}
어떤 오류가 발생합니까? – Barmar
lambda는'bool'이 아닌 불확정 유형을 산출합니다.'auto isCon =' – vu1p3n0x
관련 : https://stackoverflow.com/questions/7951377/what-is-the-type-of-lambda-when-deduced -with-auto-in-c11 – Barmar