The template argument list of a template-head is
a template argument list in which the nth template argument
has the value of
the nth template parameter of the template-head.
If the nth template parameter is
a template parameter pack ([temp.variadic]),
the nth template argument is a pack expansion
whose pattern is the name of the template parameter pack.
Names used in a template-argument
are subject to access control where they appear.
Because a template-parameter is not a class member,
no access control applies.
— end note]
[Example 3: template<class T>class X {static T t;
};
class Y {private:struct S {/* ... */};
X<S> x; // OK, S is accessible// X<Y::S> has a static member of type Y::S// OK, even though Y::S is private};
X<Y::S> y; // error: S not accessible — end example]
For a
template-argument
that is a class type or a class template, the template
definition has no special access rights to the
members of the template-argument.
[Example 4: template<template<class TT>class T>class A {typename T<int>::S s;
};
template<class U>class B {private:struct S {/* ... */};
};
A<B> b; // error: A has no access to B::S — end example]
An explicit destructor call ([class.dtor]) for an object that has a type
that is a class template specialization may explicitly specify the
template-arguments.
When name lookup for the component name of a
template-id
finds an overload set, both non-template functions in the overload
set and function templates in the overload set for
which the
template-arguments
do not match the
template-parameters
are ignored.