नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'var': a lambda capture must have automatic storage duration
Remarks
You cannot capture a variable that does not have automatic storage duration, such as a variable that is marked static or extern.
To correct this error
- Do not pass a
staticorexternvariable to the capture list of the lambda expression.
Example
The following example generates C3495 because the static variable n appears in the capture list of a lambda expression:
// C3495.cpp
int main()
{
static int n = 66;
[&n]() { return n; }(); // C3495
}