clang API Documentation
Represents a C++11 pack expansion that produces a sequence of expressions. More...
#include <ExprCXX.h>


Public Member Functions | |
| PackExpansionExpr (QualType T, Expr *Pattern, SourceLocation EllipsisLoc, Optional< unsigned > NumExpansions) | |
| PackExpansionExpr (EmptyShell Empty) | |
| Expr * | getPattern () |
| Retrieve the pattern of the pack expansion. | |
| const Expr * | getPattern () const |
| Retrieve the pattern of the pack expansion. | |
| SourceLocation | getEllipsisLoc () const |
| Retrieve the location of the ellipsis that describes this pack expansion. | |
| Optional< unsigned > | getNumExpansions () const |
| Determine the number of expansions that will be produced when this pack expansion is instantiated, if already known. | |
| SourceLocation | getLocStart () const LLVM_READONLY |
| SourceLocation | getLocEnd () const LLVM_READONLY |
| child_range | children () |
Static Public Member Functions | |
| static bool | classof (const Stmt *T) |
Friends | |
| class | ASTStmtReader |
| class | ASTStmtWriter |
Represents a C++11 pack expansion that produces a sequence of expressions.
A pack expansion expression contains a pattern (which itself is an expression) followed by an ellipsis. For example:
template<typename F, typename ...Types> void forward(F f, Types &&...args) { f(static_cast<Types&&>(args)...); }
Here, the argument to the function object f is a pack expansion whose pattern is static_cast<Types&&>(args). When the forward function template is instantiated, the pack expansion will instantiate to zero or or more function arguments to the function object f.
| clang::PackExpansionExpr::PackExpansionExpr | ( | QualType | T, |
| Expr * | Pattern, | ||
| SourceLocation | EllipsisLoc, | ||
| Optional< unsigned > | NumExpansions | ||
| ) | [inline] |
| clang::PackExpansionExpr::PackExpansionExpr | ( | EmptyShell | Empty | ) | [inline] |
| child_range clang::PackExpansionExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
| static bool clang::PackExpansionExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 3430 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
| SourceLocation clang::PackExpansionExpr::getEllipsisLoc | ( | ) | const [inline] |
Retrieve the location of the ellipsis that describes this pack expansion.
Definition at line 3414 of file ExprCXX.h.
Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern().
| SourceLocation clang::PackExpansionExpr::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
| SourceLocation clang::PackExpansionExpr::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Stmt.
Definition at line 3425 of file ExprCXX.h.
References clang::Stmt::getLocStart().
| Optional<unsigned> clang::PackExpansionExpr::getNumExpansions | ( | ) | const [inline] |
Determine the number of expansions that will be produced when this pack expansion is instantiated, if already known.
Definition at line 3418 of file ExprCXX.h.
Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern().
| Expr* clang::PackExpansionExpr::getPattern | ( | ) | [inline] |
Retrieve the pattern of the pack expansion.
Definition at line 3407 of file ExprCXX.h.
Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern().
| const Expr* clang::PackExpansionExpr::getPattern | ( | ) | const [inline] |
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.