CodeQL library for C/C++

Member predicate LambdaCapture::isCapturedByReference

Holds if the variable was captured by reference.

An identifier is captured by reference if:

  • It is explicitly captured by reference.
  • It is implicitly captured, and the lambda’s default capture mode is by-reference.
  • The identifier is “this”. [Said behaviour is dictated by the C++11 standard, but it is actually “*this” being captured rather than “this”.]
predicate isCapturedByReference()