Interface ICPPASTStructuredBindingDeclaration

    • Field Detail

      • 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 Detail

      • 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:
        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 asIASTName[]
        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 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