File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Original file line number Diff line number Diff line change 1208
1208
most derived object\iref {intro.object } ends.
1209
1209
1210
1210
\pnum
1211
- \indextext {restriction!constructor}%
1212
- A
1213
- \tcode {return}
1214
- statement in the body of a constructor shall not specify a return value.
1215
1211
\indextext {constructor!address of}%
1216
1212
The address of a constructor shall not be taken.
1213
+ \indextext {restriction!constructor}%
1214
+ \begin {note }
1215
+ A \tcode {return} statement in the body of a constructor
1216
+ cannot specify a return value\iref {stmt.return }.
1217
+ \end {note }
1217
1218
1218
1219
\pnum
1219
1220
A constructor shall not be a coroutine.
2078
2079
the selected destructor may be deleted\iref {dcl.fct.def.delete }.
2079
2080
2080
2081
\pnum
2081
- \indextext {restriction! destructor}%
2082
+ \indextext {destructor!address of }%
2082
2083
The address of a destructor shall not be taken.
2084
+ \indextext {restriction!destructor}%
2085
+ \begin {note }
2086
+ A \tcode {return} statement in the body of a destructor
2087
+ cannot specify a return value\iref {stmt.return }.
2088
+ \end {note }
2083
2089
\indextext {\idxcode {const}!destructor and}%
2084
2090
\indextext {\idxcode {volatile}!destructor and}%
2085
2091
A destructor can be invoked for a
Original file line number Diff line number Diff line change 811
811
\indextext {\idxcode {return}!constructor and}%
812
812
\indextext {\idxcode {return}!constructor and}%
813
813
A \tcode {return} statement with an operand of type \keyword {void} shall be used only
814
- in a function whose return type is \cv {}~\keyword {void}.
814
+ in a function that has a \cv {}~\keyword {void} return type .
815
815
A \tcode {return} statement with any other operand shall be used only
816
- in a function whose return type is not \cv {}~\keyword {void};
816
+ in a function that has a return type other than \cv {}~\keyword {void};
817
817
\indextext {conversion!return type}%
818
818
the \tcode {return} statement initializes the
819
819
returned reference or prvalue result object
820
820
of the (explicit or implicit) function call
821
821
by copy-initialization\iref {dcl.init } from the operand.
822
822
\begin {note }
823
+ A constructor or destructor does not have a return type.
824
+ \end {note }
825
+ \begin {note }
823
826
A \tcode {return} statement can involve
824
827
an invocation of a constructor to perform a copy or move of the operand
825
828
if it is not a prvalue or if its type differs from the return type of the function.
You can’t perform that action at this time.
0 commit comments