org.eclipse.cdt.core.dom.ast.cpp

## 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

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode

`IASTNode.CopyStyle`

### Field Summary

Fields
`static ASTNodeProperty` `IDENTIFIER` `IDENTIFIER` represents the relationship between an `ICPPASTStructuredBindingDeclaration` and its `IASTName`s.
`static ASTNodeProperty` `INITIALIZER` `INITIALIZER` represents the relationship between an `ICPPASTStructuredBindingDeclaration` and its `IASTInitializer`.

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration

`DECL_SPECIFIER, DECLARATOR`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclaration

`EMPTY_DECLARATION_ARRAY`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner

`ATTRIBUTE, ATTRIBUTE_SPECIFIER`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode

`EMPTY_NODE_ARRAY`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner

`r_declaration, r_definition, r_reference, r_unclear`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner

`IMPLICIT_NAME`

### Method Summary

All Methods Instance Methods Abstract Methods
`IASTInitializer` `getInitializer()` Returns the initializer of the structured binding declaration.
`IASTName[]` `getNames()` Returns the list of names declared by this structured binding declaration.
`ICPPASTFunctionDeclarator.RefQualifier` `getRefQualifier()` Returns the `RefQualifier` of the structured binding.

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration

`addDeclarator, copy, copy, getDeclarators, getDeclSpecifier, setDeclSpecifier`

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner

`addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiers`

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode

`accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent`

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner

`getRoleForName`

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner

`getImplicitNames`

### Field Detail

#### IDENTIFIER

    static final ASTNodeProperty IDENTIFIER

`IDENTIFIER` represents the relationship between an `ICPPASTStructuredBindingDeclaration` and its `IASTName`s.

#### INITIALIZER

    static final ASTNodeProperty INITIALIZER

`INITIALIZER` represents the relationship between an `ICPPASTStructuredBindingDeclaration` and its `IASTInitializer`.

### Method Detail

#### getRefQualifier

    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:
  `ICPPASTFunctionDeclarator.RefQualifier`

#### 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 as`IASTName[]`
See Also:
  `IASTName`

#### getInitializer

    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:
  `IASTInitializer`, `ICPPASTInitializerList`, `ICPPASTConstructorInitializer`, `IASTEqualsInitializer`