Lambda.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- Lambda.h - Types for C++ Lambdas -----------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. ///
  14. /// \file
  15. /// Defines several types used to describe C++ lambda expressions
  16. /// that are shared between the parser and AST.
  17. ///
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_CLANG_BASIC_LAMBDA_H
  20. #define LLVM_CLANG_BASIC_LAMBDA_H
  21. namespace clang {
  22. /// The default, if any, capture method for a lambda expression.
  23. enum LambdaCaptureDefault {
  24. LCD_None,
  25. LCD_ByCopy,
  26. LCD_ByRef
  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.
  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
  39. };
  40. } // end namespace clang
  41. #endif // LLVM_CLANG_BASIC_LAMBDA_H
  42. #ifdef __GNUC__
  43. #pragma GCC diagnostic pop
  44. #endif