|
5635 | 5635 |
|
5636 | 5636 | \pnum
|
5637 | 5637 | The implicit instantiation of a class template specialization causes
|
5638 |
| -the implicit instantiation of the declarations, but not of the definitions, |
5639 |
| -default arguments, or \grammarterm{noexcept-specifier}{s} of the |
5640 |
| -class member functions, |
5641 |
| -member classes, |
5642 |
| -scoped member enumerations, |
5643 |
| -static data members, |
5644 |
| -member templates, and |
5645 |
| -friends; and |
5646 |
| -it causes the implicit instantiation of the definitions of |
5647 |
| -unscoped member enumerations and member anonymous unions. |
| 5638 | +\begin{itemize} |
| 5639 | +\item |
| 5640 | + the implicit instantiation of the declarations, but not of the definitions, |
| 5641 | + of the non-deleted |
| 5642 | + class member functions, |
| 5643 | + member classes, |
| 5644 | + scoped member enumerations, |
| 5645 | + static data members, |
| 5646 | + member templates, and |
| 5647 | + friends; and |
| 5648 | +\item |
| 5649 | + the implicit instantiation of the definitions of |
| 5650 | + deleted member functions, |
| 5651 | + unscoped member enumerations, and |
| 5652 | + member anonymous unions. |
| 5653 | +\end{itemize} |
| 5654 | +The implicit instantiation of a class template specialization |
| 5655 | +does not cause the implicit instantiation of |
| 5656 | +default arguments or \grammarterm{noexcept-specifier}{s} |
| 5657 | +of the class member functions. |
| 5658 | +\begin{example} |
| 5659 | +\begin{codeblock} |
| 5660 | +template<class T> |
| 5661 | +struct C { |
| 5662 | + void f() { T x; } |
| 5663 | + void g() = delete; |
| 5664 | +}; |
| 5665 | +C<void> c; // OK, definition of \tcode{C<void>::f} is not instantiated at this point |
| 5666 | +template<> void C<int>::g() { } // error: redefinition of \tcode{C<int>::g} |
| 5667 | +\end{codeblock} |
| 5668 | +\end{example} |
5648 | 5669 | However, for the purpose of determining whether an instantiated redeclaration
|
5649 | 5670 | is valid according to~\ref{basic.def.odr} and \ref{class.mem},
|
5650 | 5671 | a declaration that corresponds to a definition in the template
|
|
0 commit comments