clang API Documentation
Data structure that captures multiple levels of template argument lists for use in template instantiation. More...
#include <Template.h>
Public Types | |
| typedef std::pair< const TemplateArgument *, unsigned > | ArgList |
Public Member Functions | |
| MultiLevelTemplateArgumentList () | |
| Construct an empty set of template argument lists. | |
| MultiLevelTemplateArgumentList (const TemplateArgumentList &TemplateArgs) | |
| Construct a single-level template argument list. | |
| unsigned | getNumLevels () const |
| Determine the number of levels in this template argument list. | |
| const TemplateArgument & | operator() (unsigned Depth, unsigned Index) const |
| Retrieve the template argument at a given depth and index. | |
| bool | hasTemplateArgument (unsigned Depth, unsigned Index) const |
| Determine whether there is a non-NULL template argument at the given depth and index. | |
| void | setArgument (unsigned Depth, unsigned Index, TemplateArgument Arg) |
| Clear out a specific template argument. | |
| void | addOuterTemplateArguments (const TemplateArgumentList *TemplateArgs) |
| Add a new outermost level to the multi-level template argument list. | |
| void | addOuterTemplateArguments (const TemplateArgument *Args, unsigned NumArgs) |
| Add a new outmost level to the multi-level template argument list. | |
| const ArgList & | getInnermost () const |
| Retrieve the innermost template argument list. | |
Data structure that captures multiple levels of template argument lists for use in template instantiation.
Multiple levels of template arguments occur when instantiating the definitions of member templates. For example:
template<typename T> struct X { template<T Value> struct Y { void f(); }; };
When instantiating X<int>::Y<17>::f, the multi-level template argument list will contain a template argument list (int) at depth 0 and a template argument list (17) at depth 1.
Definition at line 41 of file Template.h.
| typedef std::pair<const TemplateArgument *, unsigned> clang::MultiLevelTemplateArgumentList::ArgList |
Definition at line 43 of file Template.h.
| clang::MultiLevelTemplateArgumentList::MultiLevelTemplateArgumentList | ( | ) | [inline] |
Construct an empty set of template argument lists.
Definition at line 52 of file Template.h.
| clang::MultiLevelTemplateArgumentList::MultiLevelTemplateArgumentList | ( | const TemplateArgumentList & | TemplateArgs | ) | [inline, explicit] |
Construct a single-level template argument list.
Definition at line 56 of file Template.h.
References addOuterTemplateArguments().
| void clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments | ( | const TemplateArgumentList * | TemplateArgs | ) | [inline] |
Add a new outermost level to the multi-level template argument list.
Definition at line 96 of file Template.h.
References clang::TemplateArgumentList::data(), and clang::TemplateArgumentList::size().
Referenced by clang::Sema::CheckTemplateIdType(), clang::Sema::getTemplateInstantiationArgs(), and MultiLevelTemplateArgumentList().
| void clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments | ( | const TemplateArgument * | Args, |
| unsigned | NumArgs | ||
| ) | [inline] |
Add a new outmost level to the multi-level template argument list.
Definition at line 103 of file Template.h.
| const ArgList& clang::MultiLevelTemplateArgumentList::getInnermost | ( | ) | const [inline] |
Retrieve the innermost template argument list.
Definition at line 109 of file Template.h.
Referenced by clang::Sema::BuildCXXDefaultArgExpr(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().
| unsigned clang::MultiLevelTemplateArgumentList::getNumLevels | ( | ) | const [inline] |
Determine the number of levels in this template argument list.
Definition at line 62 of file Template.h.
Referenced by clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::getNumArgumentsInExpansion(), hasTemplateArgument(), operator()(), setArgument(), clang::TemplateDeclInstantiator::VisitNonTypeTemplateParmDecl(), clang::TemplateDeclInstantiator::VisitTemplateTemplateParmDecl(), and clang::TemplateDeclInstantiator::VisitTemplateTypeParmDecl().
| bool clang::MultiLevelTemplateArgumentList::hasTemplateArgument | ( | unsigned | Depth, |
| unsigned | Index | ||
| ) | const [inline] |
Determine whether there is a non-NULL template argument at the given depth and index.
There must exist a template argument list at the given depth.
Definition at line 75 of file Template.h.
References getNumLevels(), and Index.
Referenced by clang::Sema::CheckParameterPacksForExpansion(), and clang::Sema::getNumArgumentsInExpansion().
| const TemplateArgument& clang::MultiLevelTemplateArgumentList::operator() | ( | unsigned | Depth, |
| unsigned | Index | ||
| ) | const [inline] |
Retrieve the template argument at a given depth and index.
Definition at line 65 of file Template.h.
References getNumLevels(), and Index.
| void clang::MultiLevelTemplateArgumentList::setArgument | ( | unsigned | Depth, |
| unsigned | Index, | ||
| TemplateArgument | Arg | ||
| ) | [inline] |
Clear out a specific template argument.
Definition at line 85 of file Template.h.
References getNumLevels(), and Index.