|
1040 | 1040 | The implementation will implicitly declare these member functions for some class
|
1041 | 1041 | types when the program does not explicitly declare them.
|
1042 | 1042 | The implementation will implicitly define them
|
1043 |
| -if they are odr-used\iref{term.odr.use} or |
1044 |
| -needed for constant evaluation\iref{expr.const}. |
| 1043 | +as needed\iref{dcl.fct.def.default}. |
1045 | 1044 | \end{note}
|
1046 | 1045 | An implicitly-declared special member function is declared at the closing
|
1047 | 1046 | \tcode{\}} of the \grammarterm{class-specifier}.
|
|
1303 | 1302 | \defnx{non-trivial}{constructor!default!non-trivial}.
|
1304 | 1303 |
|
1305 | 1304 | \pnum
|
1306 |
| -A default constructor |
1307 |
| -that is defaulted and not defined as deleted |
1308 |
| -is |
1309 |
| -\defnx{implicitly defined}{constructor!implicitly defined} |
1310 |
| -when it is odr-used\iref{term.odr.use} |
1311 |
| -to initialize an object of its class type\iref{intro.object}, |
1312 |
| -when it is needed for constant evaluation\iref{expr.const}, or |
1313 |
| -when it is explicitly defaulted after its first declaration. |
1314 |
| -The implicitly-defined default constructor performs the set of |
| 1305 | +An implicitly-defined\iref{dcl.fct.def.default} default constructor performs the set of |
1315 | 1306 | initializations of the class that would be performed by a user-written default
|
1316 | 1307 | constructor for that class with no
|
1317 | 1308 | \grammarterm{ctor-initializer}\iref{class.base.init} and an empty
|
|
1602 | 1593 | \defnx{non-trivial}{constructor!copy!nontrivial}.
|
1603 | 1594 |
|
1604 | 1595 | \pnum
|
1605 |
| -\indextext{constructor!copy!implicitly defined}% |
1606 |
| -\indextext{constructor!move!implicitly defined}% |
1607 |
| -A copy/move constructor |
1608 |
| -that is defaulted and not defined as deleted |
1609 |
| -is |
1610 |
| -\term{implicitly defined} |
1611 |
| -when it is odr-used\iref{term.odr.use}, |
1612 |
| -when it is needed for constant evaluation\iref{expr.const}, or |
1613 |
| -when it is explicitly defaulted after its first declaration. |
1614 | 1596 | \begin{note}
|
1615 | 1597 | The copy/move constructor is implicitly defined even if the implementation elided
|
1616 | 1598 | its odr-use\iref{term.odr.use,class.temporary}.
|
1617 | 1599 | \end{note}
|
1618 |
| -If the implicitly-defined constructor would satisfy the requirements of a |
| 1600 | +If an implicitly-defined\iref{dcl.fct.def.default} constructor would satisfy the requirements of a |
1619 | 1601 | constexpr function\iref{dcl.constexpr}, the implicitly-defined
|
1620 | 1602 | constructor is \keyword{constexpr}.
|
1621 | 1603 |
|
|
1905 | 1887 | \defnx{non-trivial}{assignment operator!copy!non-trivial}.
|
1906 | 1888 |
|
1907 | 1889 | \pnum
|
1908 |
| -\indextext{assignment operator!copy!implicitly defined}% |
1909 |
| -\indextext{assignment operator!move!implicitly defined}% |
1910 |
| -A copy/move assignment operator for a class \tcode{X} |
1911 |
| -that is defaulted and not defined as deleted |
1912 |
| -is |
1913 |
| -\term{implicitly defined} |
1914 |
| -when it is odr-used\iref{term.odr.use} |
1915 |
| -(e.g., when it is selected by overload resolution |
1916 |
| -to assign to an object of its class type), |
1917 |
| -when it is needed for constant evaluation\iref{expr.const}, or |
1918 |
| -when it is explicitly defaulted after its first declaration. |
1919 |
| -The implicitly-defined copy/move assignment operator is \keyword{constexpr}. |
| 1890 | +An implicitly-defined\iref{dcl.fct.def.default} copy/move assignment operator is \keyword{constexpr}. |
1920 | 1891 |
|
1921 | 1892 | \pnum
|
1922 | 1893 | Before the defaulted copy/move assignment operator for a class is
|
|
2126 | 2097 | A defaulted destructor is a constexpr destructor
|
2127 | 2098 | if it satisfies the requirements for a constexpr function\iref{dcl.constexpr}.
|
2128 | 2099 |
|
2129 |
| -\pnum |
2130 |
| -A destructor |
2131 |
| -that is defaulted and not defined as deleted |
2132 |
| -is |
2133 |
| -\defnx{implicitly defined}{destructor!implicitly defined} |
2134 |
| -when it is odr-used\iref{term.odr.use} |
2135 |
| -or when it is explicitly defaulted after its first declaration. |
2136 |
| - |
2137 | 2100 | \pnum
|
2138 | 2101 | Before a
|
2139 | 2102 | defaulted destructor for a class is implicitly defined, all the non-user-provided
|
|
6435 | 6398 | where the implicit object parameter (if any) is considered to be
|
6436 | 6399 | the first parameter.
|
6437 | 6400 | \end{itemize}
|
6438 |
| -A comparison operator function for class \tcode{C} that |
6439 |
| -is defaulted on its first declaration and |
6440 |
| -is not defined as deleted is |
6441 |
| -\defnx{implicitly defined}{operator!comparison!implicitly defined} |
6442 |
| -when it is odr-used or needed for constant evaluation. |
6443 |
| -Name lookups in the defaulted definition |
| 6401 | +Name lookups in the implicit definition\iref{dcl.fct.def.default} |
6444 | 6402 | of a comparison operator function
|
6445 | 6403 | are performed from a context equivalent to
|
6446 | 6404 | its \grammarterm{function-body}.
|
|
0 commit comments