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
FieldsModifier and TypeFieldDescriptionstatic final ASTNodePropertyIDENTIFIERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTNames.static final ASTNodePropertyINITIALIZERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTInitializer.Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
ATTRIBUTE, ATTRIBUTE_SPECIFIERFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTDeclaration
EMPTY_DECLARATION_ARRAYFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner
IMPLICIT_NAMEFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
r_declaration, r_definition, r_reference, r_unclearFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAYFields inherited from interface org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration
DECL_SPECIFIER, DECLARATOR -
Method Summary
Modifier and TypeMethodDescription@Nullable IASTInitializerReturns the initializer of the structured binding declaration.IASTName[]getNames()Returns the list of names declared by this structured binding declaration.@Nullable ICPPASTFunctionDeclarator.RefQualifierReturns theRefQualifierof the structured binding.Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTAttributeOwner
addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiersMethods inherited from interface org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner
getImplicitNamesMethods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNameOwner
getRoleForNameMethods 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, setPropertyInParentMethods inherited from interface org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration
addDeclarator, copy, copy, getDeclarators, getDeclSpecifier, setDeclSpecifier
-
Field Details
-
IDENTIFIER
IDENTIFIERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTNames. -
INITIALIZER
INITIALIZERrepresents the relationship between anICPPASTStructuredBindingDeclarationand itsIASTInitializer.
-
-
Method Details
-
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:
- 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:
-
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:
- For
-