# lambda

`[](){}` 之前在学 scip 的时候已经很熟了，不过 C++ 的 lambda 多了个捕获列表，这个列表是针对一些外部变量的。如果我想在函数体内使用一些外部变量那么就要指定捕获列表是复制 `[=]` 还是引用 `[&]` 捕获。还有一些修饰符例如：`mutable` 允许函数体修改复制捕获 `[=]` 的对象、 `constexpr` 暂时不知道。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wandersofb.gitbook.io/blog/c++/ji-ben-yu-fa/lambda.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
