clang 20.0.0git
Lambda.h
Go to the documentation of this file.
1//===--- Lambda.h - Types for C++ Lambdas -----------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// Defines several types used to describe C++ lambda expressions
11/// that are shared between the parser and AST.
12///
13//===----------------------------------------------------------------------===//
14
15
16#ifndef LLVM_CLANG_BASIC_LAMBDA_H
17#define LLVM_CLANG_BASIC_LAMBDA_H
18
19namespace clang {
20
21/// The default, if any, capture method for a lambda expression.
26};
27
28/// The different capture forms in a lambda introducer
29///
30/// C++11 allows capture of \c this, or of local variables by copy or
31/// by reference. C++1y also allows "init-capture", where the initializer
32/// is an expression.
34 LCK_This, ///< Capturing the \c *this object by reference
35 LCK_StarThis, ///< Capturing the \c *this object by copy
36 LCK_ByCopy, ///< Capturing by copy (a.k.a., by value)
37 LCK_ByRef, ///< Capturing by reference
38 LCK_VLAType ///< Capturing variable-length array type
39};
40
41} // end namespace clang
42
43#endif // LLVM_CLANG_BASIC_LAMBDA_H
The JSON file list parser is used to communicate input to InstallAPI.
LambdaCaptureKind
The different capture forms in a lambda introducer.
Definition: Lambda.h:33
@ LCK_ByCopy
Capturing by copy (a.k.a., by value)
Definition: Lambda.h:36
@ LCK_ByRef
Capturing by reference.
Definition: Lambda.h:37
@ LCK_VLAType
Capturing variable-length array type.
Definition: Lambda.h:38
@ LCK_StarThis
Capturing the *this object by copy.
Definition: Lambda.h:35
@ LCK_This
Capturing the *this object by reference.
Definition: Lambda.h:34
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
Definition: Lambda.h:22
@ LCD_ByRef
Definition: Lambda.h:25
@ LCD_None
Definition: Lambda.h:23
@ LCD_ByCopy
Definition: Lambda.h:24