1 //===--- Lambda.h - Types for C++ Lambdas -----------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
10 /// Defines several types used to describe C++ lambda expressions
11 /// that are shared between the parser and AST.
13 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_BASIC_LAMBDA_H
17 #define LLVM_CLANG_BASIC_LAMBDA_H
21 /// The default, if any, capture method for a lambda expression.
22 enum LambdaCaptureDefault {
28 /// The different capture forms in a lambda introducer
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
33 enum LambdaCaptureKind {
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
41 } // end namespace clang
43 #endif // LLVM_CLANG_BASIC_LAMBDA_H