|
580 | 580 | shall either |
581 | 581 | declare at least one member name of the class |
582 | 582 | or declare at least one unnamed bit-field. |
| 583 | +A \defnx{user-declared}{entity!user-declared} |
| 584 | +\indextext{user-declared entity|see{entity, user-declared}} |
| 585 | +entity is a direct member or a friend that, in either case, |
| 586 | +is declared by a \grammarterm{member-declaration}. |
583 | 587 |
|
584 | 588 | \pnum |
585 | 589 | A \defn{data member} is either a non-function member introduced by a |
|
1273 | 1277 | has a default argument |
1274 | 1278 | (including the case of a constructor with no parameters). |
1275 | 1279 | \indextext{implicitly-declared default constructor}% |
1276 | | -If there is no user-declared constructor or constructor template for class |
1277 | | -\tcode{X} and \tcode{X} is not an anonymous union, |
| 1280 | +If a class does not have |
| 1281 | +a user-declared constructor or constructor template, |
| 1282 | +and the class is not an anonymous union, |
1278 | 1283 | a non-explicit constructor having no parameters is implicitly declared |
1279 | 1284 | as defaulted\iref{dcl.fct.def}. |
1280 | 1285 | An implicitly-declared default constructor is an |
|
1503 | 1508 | \end{example} |
1504 | 1509 |
|
1505 | 1510 | \pnum |
1506 | | -If the class definition does not explicitly declare a copy constructor |
| 1511 | +If the class does not have a user-declared copy constructor |
1507 | 1512 | and the class is not an anonymous union, |
1508 | 1513 | a non-explicit one is declared \defnx{implicitly}{constructor!copy!implicitly declared}. |
1509 | 1514 | If the class definition declares a move |
|
1544 | 1549 |
|
1545 | 1550 | \pnum |
1546 | 1551 | \indextext{constructor!move!implicitly declared}% |
1547 | | -If the definition of a class \tcode{X} does not explicitly declare |
1548 | | -a move constructor, a non-explicit one will be |
| 1552 | +If a class \tcode{X} does not have |
| 1553 | +a user-declared move constructor, a non-explicit one will be |
1549 | 1554 | implicitly declared as defaulted if and only if |
1550 | 1555 | \begin{itemize} |
1551 | 1556 | \item |
|
1605 | 1610 | an rvalue which can use the copy constructor instead. |
1606 | 1611 | \end{note} |
1607 | 1612 |
|
| 1613 | +\pnum |
| 1614 | +\begin{note} |
| 1615 | +A using-declaration in a derived class \tcode{C} that |
| 1616 | +names a constructor from a base class |
| 1617 | +never suppresses the implicit declaration of |
| 1618 | +a copy/move constructor of \tcode{C}, |
| 1619 | +even if the base class constructor would be |
| 1620 | +a copy or move constructor |
| 1621 | +if declared as a member of \tcode{C}. |
| 1622 | +\end{note} |
| 1623 | + |
1608 | 1624 | \pnum |
1609 | 1625 | \indextext{constructor!copy!trivial}% |
1610 | 1626 | \indextext{constructor!move!trivial}% |
|
1746 | 1762 | \end{note} |
1747 | 1763 |
|
1748 | 1764 | \pnum |
1749 | | -If the class definition does not explicitly declare a copy assignment operator |
| 1765 | +If the class does not have a user-declared copy assignment operator |
1750 | 1766 | and the class is not an anonymous union, |
1751 | 1767 | one is declared \defnx{implicitly}{assignment operator!copy!implicitly declared}. |
1752 | | -If the class definition declares a move |
| 1768 | +If the class has a user-declared move |
1753 | 1769 | constructor or move assignment operator, the implicitly declared copy |
1754 | 1770 | assignment operator is defined as deleted; otherwise, it is |
1755 | 1771 | defaulted\iref{dcl.fct.def}. |
|
0 commit comments