Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
a lambda definition cannot have any cv-qualifiers
Remarks
You can't use a const or volatile qualifier as part of the definition of a lambda expression.
This error is obsolete in Visual Studio 2022.
To correct this error
- Remove the
constorvolatilequalifier from the definition of your lambda expression.
Example
The following example generates C3485 because it uses the const qualifier as part of the definition of a lambda expression:
// C3485.cpp
int main()
{
auto x = []() const mutable {}; // C3485
}
To fix it, remove the const qualifier.