Closed ranaanoop closed 2 months ago
The entire paragraph seems redundant, given https://eel.is/c++draft/temp.arg.explicit#4 and the preceding p3 which talks about explicit instantiations.
@jensmaurer Yes, It(temp.explicit#8) does seem redundant. Maybe we should remove that paragraph and just update the example given there to as shown below. This can be then editorial perhaps.
template<class T> class Array { /* ... */ };
template<class T, typename U = double> void sort(Array<T>& v) { /* ... */ }
// instantiate void sort<int, double>(Array<int>&) -- template-argument deduced and defaulted
template void sort<>(Array<int>&);
// instantiate void sort<double, double>(Array<double>&) -- template-argument deduced and defaulted
template void sort(Array<double>&);
CWG2848
Full name of submitter: Anoop Rana
Reference (section label): [temp.explicit]
Issue description: Currently the wording in [temp.explicit] does not allow for empty
<>
to be omitted when all of the template arguments can be obtained from the default arguments. Additionally, it also does not allow for the trailing template argument to be left unspecified if it can be obtained from default argument. The below example shows the issue:The current wording in temp.explicit#8 states:
Suggested resolution:
Change [temp.explicit#8] to as indicated/highlighted below:
After the suggested changes, the two statements(involving explicit instantiation) will be well-formed.