Package 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
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
-
-
Field Summary
Fields Modifier and Type Field Description static ASTNodePropertyIDENTIFIERIDENTIFIERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTNames.static ASTNodePropertyINITIALIZERINITIALIZERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTInitializer.-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIER
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclaration
EMPTY_DECLARATION_ARRAY
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner
IMPLICIT_NAME
-
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.IASTNode
EMPTY_NODE_ARRAY
-
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration
DECL_SPECIFIER, DECLARATOR
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable IASTInitializergetInitializer()Returns the initializer of the structured binding declaration.IASTName[]getNames()Returns the list of names declared by this structured binding declaration.@Nullable ICPPASTFunctionDeclarator.RefQualifiergetRefQualifier()Returns theRefQualifierof the structured binding.-
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.IASTImplicitNameOwner
getImplicitNames
-
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
getRoleForName
-
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.IASTSimpleDeclaration
addDeclarator, copy, copy, getDeclarators, getDeclSpecifier, setDeclSpecifier
-
-
-
-
Field Detail
-
IDENTIFIER
static final ASTNodeProperty IDENTIFIER
IDENTIFIERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTNames.
-
INITIALIZER
static final ASTNodeProperty INITIALIZER
INITIALIZERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTInitializer.
-
-
Method Detail
-
getRefQualifier
@Nullable ICPPASTFunctionDeclarator.RefQualifier getRefQualifier()
Returns theRefQualifierof the structured binding. For either lvalue or rvalue reference qualifiers.Examples:
- For
auto [x, y] = coordinate;it returns the emptyOptional - For
auto & [x, y] = coordinate;it returnsOptional.of(RefQualifier.LVALUE) - For
auto && [x, y] = createCoordinte();it returnsOptional.of(RefQualifier.RVALUE)
- Returns:
- The returned
RefQualifierof the C++ declaration ornullif there is no reference qualifier. if the structured binding does not have a reference qualifier. - See Also:
ICPPASTFunctionDeclarator.RefQualifier
- For
-
getNames
IASTName[] getNames()
Returns the list of names declared by this structured binding declaration.Example: For
auto & [x, y] = coordinate;it returns the namesxandy.- Returns:
- All declared names of the structured binding as
IASTName[] - See Also:
IASTName
-
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 anICPPASTInitializerList - For
auto & [x, y](coordinate);it returns anICPPASTConstructorInitializer - For
auto && [x, y] = createCoordinte();it returns anIASTEqualsInitializer
- Returns:
- The
IASTInitializerof this structured binding. It can benullif the C++ declaration is lacking an initializer. - See Also:
IASTInitializer,ICPPASTInitializerList,ICPPASTConstructorInitializer,IASTEqualsInitializer
- For
-
-