aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Sema/Template.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/clang/Sema/Template.h b/include/clang/Sema/Template.h
index 4edfa0a45d..6e054c463a 100644
--- a/include/clang/Sema/Template.h
+++ b/include/clang/Sema/Template.h
@@ -40,10 +40,9 @@ namespace clang {
/// list will contain a template argument list (int) at depth 0 and a
/// template argument list (17) at depth 1.
class MultiLevelTemplateArgumentList {
- public:
- typedef std::pair<const TemplateArgument *, unsigned> ArgList;
-
- private:
+ /// \brief The template argument list at a certain template depth
+ typedef ArrayRef<TemplateArgument> ArgList;
+
/// \brief The template argument lists, stored from the innermost template
/// argument list (first) to the outermost template argument list (last).
SmallVector<ArgList, 4> TemplateArgumentLists;
@@ -65,8 +64,8 @@ namespace clang {
/// \brief Retrieve the template argument at a given depth and index.
const TemplateArgument &operator()(unsigned Depth, unsigned Index) const {
assert(Depth < TemplateArgumentLists.size());
- assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].second);
- return TemplateArgumentLists[getNumLevels() - Depth - 1].first[Index];
+ assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].size());
+ return TemplateArgumentLists[getNumLevels() - Depth - 1][Index];
}
/// \brief Determine whether there is a non-NULL template argument at the
@@ -76,7 +75,7 @@ namespace clang {
bool hasTemplateArgument(unsigned Depth, unsigned Index) const {
assert(Depth < TemplateArgumentLists.size());
- if (Index >= TemplateArgumentLists[getNumLevels() - Depth - 1].second)
+ if (Index >= TemplateArgumentLists[getNumLevels() - Depth - 1].size())
return false;
return !(*this)(Depth, Index).isNull();
@@ -86,9 +85,9 @@ namespace clang {
void setArgument(unsigned Depth, unsigned Index,
TemplateArgument Arg) {
assert(Depth < TemplateArgumentLists.size());
- assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].second);
+ assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].size());
const_cast<TemplateArgument&>(
- TemplateArgumentLists[getNumLevels() - Depth - 1].first[Index])
+ TemplateArgumentLists[getNumLevels() - Depth - 1][Index])
= Arg;
}