public interface ICPPASTStructuredBindingDeclaration extends IASTSimpleDeclaration, IASTNameOwner, IASTImplicitNameOwner
Examples:
auto [x, y]{coordinate};
auto & [x, y](coordinate);
auto && [x, y] = createCoordinte();
IASTNode.CopyStyle
Modifier and Type | Field and Description |
---|---|
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 . |
DECL_SPECIFIER, DECLARATOR
EMPTY_DECLARATION_ARRAY
ATTRIBUTE, ATTRIBUTE_SPECIFIER
EMPTY_NODE_ARRAY
r_declaration, r_definition, r_reference, r_unclear
IMPLICIT_NAME
Modifier and Type | Method and Description |
---|---|
@Nullable IASTInitializer |
getInitializer()
Returns the initializer of the structured binding declaration.
|
IASTName[] |
getNames()
Returns the list of names declared by this structured binding declaration.
|
@Nullable ICPPASTFunctionDeclarator.RefQualifier |
getRefQualifier()
Returns the
RefQualifier of the structured binding. |
addDeclarator, copy, copy, getDeclarators, getDeclSpecifier, setDeclSpecifier
addAttribute, addAttributeSpecifier, getAttributes, getAttributeSpecifiers
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent
getRoleForName
getImplicitNames
static final ASTNodeProperty IDENTIFIER
IDENTIFIER
represents the relationship between an
ICPPASTStructuredBindingDeclaration
and its
IASTName
s.static final ASTNodeProperty INITIALIZER
INITIALIZER
represents the relationship between an
ICPPASTStructuredBindingDeclaration
and its IASTInitializer
.@Nullable ICPPASTFunctionDeclarator.RefQualifier getRefQualifier()
RefQualifier
of the structured binding. For either lvalue or
rvalue reference qualifiers.
Examples:
auto [x, y] = coordinate;
it returns the empty Optional
auto & [x, y] = coordinate;
it returns Optional.of(RefQualifier.LVALUE)
auto && [x, y] = createCoordinte();
it returns Optional.of(RefQualifier.RVALUE)
RefQualifier
of the C++ declaration or null
if there is no reference qualifier.
if the structured binding does not have a reference qualifier.ICPPASTFunctionDeclarator.RefQualifier
IASTName[] getNames()
Example: For auto & [x, y] = coordinate;
it returns the names x
and y
.
IASTName[]
IASTName
@Nullable IASTInitializer getInitializer()
auto [x, y]{coordinate};
it returns an ICPPASTInitializerList
auto & [x, y](coordinate);
it returns an ICPPASTConstructorInitializer
auto && [x, y] = createCoordinte();
it returns an IASTEqualsInitializer
IASTInitializer
of this structured binding. It can be null
if the C++ declaration is lacking an initializer.IASTInitializer
,
ICPPASTInitializerList
,
ICPPASTConstructorInitializer
,
IASTEqualsInitializer
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.