clang API Documentation

Public Member Functions | Static Public Member Functions | Friends
clang::PackExpansionType Class Reference

Represents a pack expansion of types. More...

#include <Type.h>

Inheritance diagram for clang::PackExpansionType:
Inheritance graph
[legend]
Collaboration diagram for clang::PackExpansionType:
Collaboration graph
[legend]

List of all members.

Public Member Functions

QualType getPattern () const
 Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated when instantiating the pack expansion itself.
Optional< unsignedgetNumExpansions () const
 Retrieve the number of expansions that this pack expansion will generate, if known.
bool isSugared () const
QualType desugar () const
void Profile (llvm::FoldingSetNodeID &ID)

Static Public Member Functions

static void Profile (llvm::FoldingSetNodeID &ID, QualType Pattern, Optional< unsigned > NumExpansions)
static bool classof (const Type *T)

Friends

class ASTContext

Detailed Description

Represents a pack expansion of types.

Pack expansions are part of C++0x variadic templates. A pack expansion contains a pattern, which itself contains one or more "unexpanded" parameter packs. When instantiated, a pack expansion produces a series of types, each instantiated from the pattern of the expansion, where the Ith instantiation of the pattern uses the Ith arguments bound to each of the unexpanded parameter packs. The pack expansion is considered to "expand" these unexpanded parameter packs.

 template<typename ...Types> struct tuple;

 template<typename ...Types>
 struct tuple_of_references {
   typedef tuple<Types&...> type;
 };

Here, the pack expansion Types&... is represented via a PackExpansionType whose pattern is Types&.

Definition at line 4230 of file Type.h.


Member Function Documentation

static bool clang::PackExpansionType::classof ( const Type T) [inline, static]

Definition at line 4283 of file Type.h.

References clang::Type::getTypeClass().

Definition at line 4269 of file Type.h.

Retrieve the number of expansions that this pack expansion will generate, if known.

Definition at line 4261 of file Type.h.

Referenced by clang::Sema::getTemplateArgumentPackExpansionPattern(), and clang::TreeTransform< Derived >::TransformFunctionTypeParams().

Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated when instantiating the pack expansion itself.

Definition at line 4257 of file Type.h.

Referenced by DeduceTemplateArguments(), and clang::Sema::DeduceTemplateArguments().

Definition at line 4268 of file Type.h.

References clang::Type::isDependentType().

void clang::PackExpansionType::Profile ( llvm::FoldingSetNodeID &  ID) [inline]

Definition at line 4271 of file Type.h.

Referenced by clang::ASTContext::getPackExpansionType().

static void clang::PackExpansionType::Profile ( llvm::FoldingSetNodeID &  ID,
QualType  Pattern,
Optional< unsigned NumExpansions 
) [inline, static]

Definition at line 4275 of file Type.h.

References clang::QualType::getAsOpaquePtr().


Friends And Related Function Documentation

friend class ASTContext [friend]

Reimplemented from clang::Type.

Definition at line 4251 of file Type.h.


The documentation for this class was generated from the following file: