I am trying to understand P0091r3 (the document "template argument for class templates" that has been adopted in the current standard C ++ project, N4606).
I believe that I understand how this works in the simplest case when a template name identifies one template:
template<class T>
struct S {
S(T);
S(const std::vector<T>&);
};
int main()
{
std::vector<int> v;
auto s = S(v);
}
S identifies the primary template, so we create a dummy overload set consisting of
template<class T> void Sctor(T);
template<class T> void Sctor(const std::vector<T>&);
and perform overload resolution on a fake call
Sctor(v)
to determine what in this case we want to call fictitious Sctor(const std::vector<T>&) [with T=int]. This means that we end up calling S<int>::S(const std::vector<int>&), and everything works just fine.
I do not understand how this should work in the presence of partial specialization.
template<class T>
struct S {
S(T);
};
template<class T>
struct S<std::list<T>> {
S(const std::vector<T>&);
};
int main()
{
std::vector<int> v;
auto s = S(v);
}
, , S<std::list<int>>::S(const std::vector<int>&). , ? ?
, P0091r3 " , ": ?
( , P0091r3 §7.1.6.2p2, ,
template<class T>
struct iterator {
iterator& operator++(int) {
iterator result = *this;
}
};
.)
Clang GCC (, -f, -fconcepts)? , , , .