नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'var': a lambda capture variable must be from an enclosing function scope
Remarks
The lambda capture variable is not from an enclosing function scope.
To correct this error
- Remove the variable from the capture list of the lambda expression.
Example
The following example generates C3480 because the variable global is not from an enclosing function scope:
// C3480a.cpp
int global = 0;
int main()
{
[&global] { global = 5; }(); // C3480
}
The following example resolves C3480 by removing the variable global from the capture list of the lambda expression:
// C3480b.cpp
int global = 0;
int main()
{
[] { global = 5; }();
}