Skip to content

Commit 10b8762

Browse files
burblebeetkoeppe
authored andcommitted
LWG3817 Missing preconditions on forward_list modifiers
Fixes NB GB 101 (C++23 CD).
1 parent 4086402 commit 10b8762

File tree

1 file changed

+36
-10
lines changed

1 file changed

+36
-10
lines changed

source/containers.tex

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7273,12 +7273,33 @@
72737273
\indexlibrarymember{insert_after}{forward_list}%
72747274
\begin{itemdecl}
72757275
iterator insert_after(const_iterator position, const T& x);
7276+
\end{itemdecl}
7277+
7278+
\begin{itemdescr}
7279+
\pnum
7280+
\expects
7281+
\tcode{T} is \oldconcept{CopyInsertable} into \tcode{forward_list}.
7282+
\tcode{position} is \tcode{before_begin()} or is a dereferenceable
7283+
iterator in the range \range{begin()}{end()}.
7284+
7285+
\pnum
7286+
\effects
7287+
Inserts a copy of \tcode{x} after \tcode{position}.
7288+
7289+
\pnum
7290+
\returns
7291+
An iterator pointing to the copy of \tcode{x}.
7292+
\end{itemdescr}
7293+
7294+
\indexlibrarymember{insert_after}{forward_list}%
7295+
\begin{itemdecl}
72767296
iterator insert_after(const_iterator position, T&& x);
72777297
\end{itemdecl}
72787298

72797299
\begin{itemdescr}
72807300
\pnum
72817301
\expects
7302+
\tcode{T} is \oldconcept{MoveInsertable} into \tcode{forward_list}.
72827303
\tcode{position} is \tcode{before_begin()} or is a dereferenceable
72837304
iterator in the range \range{begin()}{end()}.
72847305

@@ -7299,6 +7320,7 @@
72997320
\begin{itemdescr}
73007321
\pnum
73017322
\expects
7323+
\tcode{T} is \oldconcept{CopyInsertable} into \tcode{forward_list}.
73027324
\tcode{position} is \tcode{before_begin()} or is a dereferenceable
73037325
iterator in the range \range{begin()}{end()}.
73047326

@@ -7308,7 +7330,8 @@
73087330

73097331
\pnum
73107332
\returns
7311-
An iterator pointing to the last inserted copy of \tcode{x} or \tcode{position} if \tcode{n == 0}.
7333+
An iterator pointing to the last inserted copy of \tcode{x}, or
7334+
\tcode{position} if \tcode{n == 0} is \tcode{true}.
73127335
\end{itemdescr}
73137336

73147337
\indexlibrarymember{insert_after}{forward_list}%
@@ -7320,6 +7343,8 @@
73207343
\begin{itemdescr}
73217344
\pnum
73227345
\expects
7346+
\tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{forward_list}
7347+
from \tcode{*first}.
73237348
\tcode{position} is \tcode{before_begin()} or is a dereferenceable
73247349
iterator in the range \range{begin()}{end()}.
73257350
Neither \tcode{first} nor \tcode{last} are iterators in \tcode{*this}.
@@ -7330,7 +7355,8 @@
73307355

73317356
\pnum
73327357
\returns
7333-
An iterator pointing to the last inserted element or \tcode{position} if \tcode{first == last}.
7358+
An iterator pointing to the last inserted element, or
7359+
\tcode{position} if \tcode{first == last} is \tcode{true}.
73347360
\end{itemdescr}
73357361

73367362
\indexlibrarymember{insert_range_after}{forward_list}%
@@ -7342,7 +7368,9 @@
73427368
\begin{itemdescr}
73437369
\pnum
73447370
\expects
7345-
\tcode{position} is \tcode{before_begin()} or
7371+
\tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{forward_list}
7372+
from \tcode{*ranges::begin(rg)}.
7373+
\tcode{posi\-tion} is \tcode{before_begin()} or
73467374
is a dereferenceable iterator in the range \range{begin()}{end()}.
73477375
\tcode{rg} and \tcode{*this} do not overlap.
73487376

@@ -7364,11 +7392,7 @@
73647392
\begin{itemdescr}
73657393
\pnum
73667394
\effects
7367-
\tcode{insert_after(position, il.begin(), il.end())}.
7368-
7369-
\pnum
7370-
\returns
7371-
An iterator pointing to the last inserted element or \tcode{position} if \tcode{il} is empty.
7395+
Equivalent to: \tcode{return insert_after(position, il.begin(), il.end());}
73727396
\end{itemdescr}
73737397

73747398

@@ -7381,13 +7405,15 @@
73817405
\begin{itemdescr}
73827406
\pnum
73837407
\expects
7408+
\tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{forward_list}
7409+
from \tcode{std::forward<Args>(\linebreak args)...}.
73847410
\tcode{position} is \tcode{before_begin()} or is a dereferenceable
73857411
iterator in the range \range{begin()}{end()}.
73867412

73877413
\pnum
73887414
\effects
7389-
Inserts an object of type \tcode{value_type} constructed with
7390-
\tcode{value_type(std::forward<Args>(\brk{}args)...)} after \tcode{position}.
7415+
Inserts an object of type \tcode{value_type} direct-non-list-initialized with
7416+
\tcode{std::forward<Args>(\linebreak args)...} after \tcode{position}.
73917417

73927418
\pnum
73937419
\returns

0 commit comments

Comments
 (0)