Interface ICPPASTStructuredBindingDeclaration

All Superinterfaces:
IASTAttributeOwner, IASTDeclaration, IASTImplicitNameOwner, IASTNameOwner, IASTNode, IASTSimpleDeclaration

public interface ICPPASTStructuredBindingDeclaration extends IASTSimpleDeclaration, IASTNameOwner, IASTImplicitNameOwner
This is a structured binding declaration which contains a sequence names, in square brackets, that decompose an initializer.

Examples:

  • auto [x, y]{coordinate};
  • auto & [x, y](coordinate);
  • auto && [x, y] = createCoordinte();
Since:
6.9
Restriction:
This interface is not intended to be implemented by clients.
Restriction:
This interface is not intended to be extended by clients.
  • Field Details

    • IDENTIFIER

      static final ASTNodeProperty IDENTIFIER
      IDENTIFIER represents the relationship between an ICPPASTStructuredBindingDeclaration and its IASTNames.
    • INITIALIZER

      static final ASTNodeProperty INITIALIZER
      INITIALIZER represents the relationship between an ICPPASTStructuredBindingDeclaration and its IASTInitializer.
  • Method Details

    • getRefQualifier

      @Nullable ICPPASTFunctionDeclarator.RefQualifier getRefQualifier()
      Returns the RefQualifier of the structured binding. For either lvalue or rvalue reference qualifiers.

      Examples:

      • For auto [x, y] = coordinate; it returns the empty Optional
      • For auto & [x, y] = coordinate; it returns Optional.of(RefQualifier.LVALUE)
      • For auto && [x, y] = createCoordinte(); it returns Optional.of(RefQualifier.RVALUE)
      Returns:
      The returned RefQualifier of the C++ declaration or null if there is no reference qualifier. if the structured binding does not have a reference qualifier.
      See Also:
    • getNames

      IASTName[] getNames()
      Returns the list of names declared by this structured binding declaration.

      Example: For auto & [x, y] = coordinate; it returns the names x and y.

      Returns:
      All declared names of the structured binding asIASTName[]
      See Also:
    • getInitializer

      @Nullable IASTInitializer getInitializer()
      Returns the initializer of the structured binding declaration. This will not be present if the structured binding is part of a range-based for loop. * Examples:
      • For auto [x, y]{coordinate}; it returns an ICPPASTInitializerList
      • For auto & [x, y](coordinate); it returns an ICPPASTConstructorInitializer
      • For auto && [x, y] = createCoordinte(); it returns an IASTEqualsInitializer
      Returns:
      The IASTInitializer of this structured binding. It can be null if the C++ declaration is lacking an initializer.
      See Also: