![]() > ret, where ret specifies the return type. (For example, the ] attribute cannot be used.) Any attribute so specified does not appertain to the function call operator or operator template itself, but its type. Provides the attribute specification for the type of the function call operator or operator template of the closure type. Provides the dynamic exception specification or (until C++20) the noexcept specifier for operator ( ) of the closure type mutable and static cannot be used at the same time, and captures must be empty if static is present. static: specifies that the function call operator or any given operator template specialization is a static member function.consteval and constexpr cannot be used at the same time. consteval: specifies that the function call operator or any given operator template specialization is an immediate function.When this specifier is not present, the function call operator or any given operator template specialization will be constexpr anyway, if it happens to satisfy all constexpr function requirements constexpr: explicitly specifies that the function call operator or any given operator template specialization is a constexpr function.mutable: allows body to modify the objects captured by copy, and to call their non-const member functions.The following specifiers are allowed at most once in each sequence: If not provided, the objects captured by copy are const in the lambda body. The list of parameters, as in named functions.Ĭonsists of specifiers, exception, attr and trailing-return-type in that order each of these components is optional is constexpr and has no mutable members.Ī non-empty comma-separated list of template parameters, used to provide names to the template parameters of a generic lambda (see ClosureType::operator() below).has const non-volatile integral or enumeration type and has been initialized with a constant expression, or.is a reference that has been initialized with a constant expression.Ī lambda expression can read the value of a variable without capturing it if the variable.is a non-local variable or has static or thread local storage duration (in which case the variable cannot be captured), or.See below for the detailed description of captures.Ī lambda expression can use a variable without capturing it if the variable Explanation capturesĪ comma-separated list of zero or more captures, optionally beginning with a capture-default. 4) Same as (2), but specifies a generic lambda and explicitly provides a list of template parameters. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |