class LambdaCapture
Declaration
class LambdaCapture { /* full declaration omitted */ };
Description
Describes the capture of a variable or of \c this, or of a C++1y init-capture.
Declared at: clang/include/clang/AST/LambdaCapture.h:25
Member Variables
- private llvm::PointerIntPair<Decl*, 3> DeclAndBits
- private clang::SourceLocation Loc
- private clang::SourceLocation EllipsisLoc
Method Overview
- public LambdaCapture(clang::SourceLocation Loc, bool Implicit, clang::LambdaCaptureKind Kind, clang::VarDecl * Var = nullptr, clang::SourceLocation EllipsisLoc = clang::SourceLocation())
- public bool capturesThis() const
- public bool capturesVLAType() const
- public bool capturesVariable() const
- public clang::LambdaCaptureKind getCaptureKind() const
- public clang::VarDecl * getCapturedVar() const
- public clang::SourceLocation getEllipsisLoc() const
- public clang::SourceLocation getLocation() const
- public bool isExplicit() const
- public bool isImplicit() const
- public bool isPackExpansion() const
Methods
¶LambdaCapture(clang::SourceLocation Loc,
bool Implicit,
clang::LambdaCaptureKind Kind,
clang::VarDecl* Var = nullptr,
clang::SourceLocation EllipsisLoc =
clang::SourceLocation())
LambdaCapture(clang::SourceLocation Loc,
bool Implicit,
clang::LambdaCaptureKind Kind,
clang::VarDecl* Var = nullptr,
clang::SourceLocation EllipsisLoc =
clang::SourceLocation())
Description
Create a new capture of a variable or of \c this.
Declared at: clang/include/clang/AST/LambdaCapture.h:73
Parameters
- clang::SourceLocation Loc
- The source location associated with this capture.
- bool Implicit
- Whether the capture was implicit or explicit.
- clang::LambdaCaptureKind Kind
- The kind of capture (this, byref, bycopy), which must not be init-capture.
- clang::VarDecl* Var = nullptr
- The local variable being captured, or null if capturing\c this.
- clang::SourceLocation EllipsisLoc = clang::SourceLocation()
- The location of the ellipsis (...) for a capture that is a pack expansion, or an invalid source location to indicate that this is not a pack expansion.
¶bool capturesThis() const
bool capturesThis() const
Description
Determine whether this capture handles the C++ \c this pointer.
Declared at: clang/include/clang/AST/LambdaCapture.h:82
¶bool capturesVLAType() const
bool capturesVLAType() const
Description
Determine whether this captures a variable length array bound expression.
Declared at: clang/include/clang/AST/LambdaCapture.h:94
¶bool capturesVariable() const
bool capturesVariable() const
Description
Determine whether this capture handles a variable.
Declared at: clang/include/clang/AST/LambdaCapture.h:88
¶clang::LambdaCaptureKind getCaptureKind() const
clang::LambdaCaptureKind getCaptureKind() const
Description
Determine the kind of capture.
Declared at: clang/include/clang/AST/LambdaCapture.h:78
¶clang::VarDecl* getCapturedVar() const
clang::VarDecl* getCapturedVar() const
Description
Retrieve the declaration of the local variable being captured. This operation is only valid if this capture is a variable capture (other than a capture of \c this).
Declared at: clang/include/clang/AST/LambdaCapture.h:104
¶clang::SourceLocation getEllipsisLoc() const
clang::SourceLocation getEllipsisLoc() const
Description
Retrieve the location of the ellipsis for a capture that is a pack expansion.
Declared at: clang/include/clang/AST/LambdaCapture.h:133
¶clang::SourceLocation getLocation() const
clang::SourceLocation getLocation() const
Description
Retrieve the source location of the capture. For an explicit capture, this returns the location of the explicit capture in the source. For an implicit capture, this returns the location at which the variable or \c this was first used.
Declared at: clang/include/clang/AST/LambdaCapture.h:125
¶bool isExplicit() const
bool isExplicit() const
Description
Determine whether this was an explicit capture (written between the square brackets introducing the lambda).
Declared at: clang/include/clang/AST/LambdaCapture.h:117
¶bool isImplicit() const
bool isImplicit() const
Description
Determine whether this was an implicit capture (not written between the square brackets introducing the lambda).
Declared at: clang/include/clang/AST/LambdaCapture.h:111
¶bool isPackExpansion() const
bool isPackExpansion() const
Description
Determine whether this capture is a pack expansion, which captures a function parameter pack.
Declared at: clang/include/clang/AST/LambdaCapture.h:129