clang API Documentation

Lambda.h
Go to the documentation of this file.
00001 //===--- Lambda.h - Types for C++ Lambdas -----------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 ///
00010 /// \file
00011 /// \brief Defines several types used to describe C++ lambda expressions
00012 /// that are shared between the parser and AST.
00013 ///
00014 //===----------------------------------------------------------------------===//
00015 
00016 
00017 #ifndef LLVM_CLANG_BASIC_LAMBDA_H
00018 #define LLVM_CLANG_BASIC_LAMBDA_H
00019 
00020 namespace clang {
00021 
00022 /// \brief The default, if any, capture method for a lambda expression.
00023 enum LambdaCaptureDefault {
00024   LCD_None,
00025   LCD_ByCopy,
00026   LCD_ByRef
00027 };
00028 
00029 /// \brief The different capture forms in a lambda introducer
00030 ///
00031 /// C++11 allows capture of \c this, or of local variables by copy or
00032 /// by reference.  C++1y also allows "init-capture", where the initializer
00033 /// is an expression.
00034 enum LambdaCaptureKind {
00035   LCK_This,   ///< Capturing the \c this pointer
00036   LCK_ByCopy, ///< Capturing by copy (a.k.a., by value)
00037   LCK_ByRef,  ///< Capturing by reference
00038   LCK_VLAType ///< Capturing variable-length array type
00039 };
00040 
00041 } // end namespace clang
00042 
00043 #endif // LLVM_CLANG_BASIC_LAMBDA_H