Skip to content

Commit ff2298e

Browse files
authored
Merge 2022-11 LWG Motion 8
P2704R0 C++ Standard Library Immediate Issues
2 parents 3e9fc48 + 60fb503 commit ff2298e

File tree

10 files changed

+178
-131
lines changed

10 files changed

+178
-131
lines changed

source/containers.tex

Lines changed: 48 additions & 18 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
@@ -14621,10 +14647,12 @@
1462114647
\end{note}
1462214648

1462314649
\pnum
14624-
Any sequence container\iref{sequence.reqmts} \tcode{C}
14625-
supporting \oldconcept{RandomAccessIterator} can be used
14626-
to instantiate \tcode{flat_map},
14627-
as long as invocations of
14650+
Any type \tcode{C}
14651+
that meets the sequence container requirements\iref{sequence.reqmts}
14652+
can be used to instantiate \tcode{flat_map},
14653+
as long as
14654+
\tcode{C::iterator} meets the \oldconcept{RandomAccessIterator} requirements and
14655+
invocations of
1462814656
member functions \tcode{C::size} and \tcode{C::max_size} do not exit via an exception.
1462914657
In particular, \tcode{vector}\iref{vector} and \tcode{deque}\iref{deque}
1463014658
can be used.
@@ -15763,10 +15791,12 @@
1576315791
\end{note}
1576415792

1576515793
\pnum
15766-
Any sequence container\iref{sequence.reqmts} \tcode{C}
15767-
supporting \oldconcept{RandomAccessIterator} can be used to
15768-
instantiate \tcode{flat_multimap},
15769-
as long as invocations of
15794+
Any type \tcode{C}
15795+
that meets the sequence container requirements\iref{sequence.reqmts}
15796+
can be used to instantiate \tcode{flat_multimap},
15797+
as long as
15798+
\tcode{C::iterator} meets the \oldconcept{RandomAccessIterator} requirements and
15799+
invocations of
1577015800
member functions \tcode{C::size} and \tcode{C::max_size} do not exit via an exception.
1577115801
In particular,
1577215802
\tcode{vector}\iref{vector} and \tcode{deque}\iref{deque} can be used.

source/diagnostics.tex

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,13 +1752,9 @@
17521752
template<class Allocator>
17531753
string to_string(const basic_stacktrace<Allocator>& st);
17541754

1755-
template<class charT, class traits>
1756-
basic_ostream<charT, traits>&
1757-
operator<<(basic_ostream<charT, traits>& os, const stacktrace_entry& f);
1758-
1759-
template<class charT, class traits, class Allocator>
1760-
basic_ostream<charT, traits>&
1761-
operator<<(basic_ostream<charT, traits>& os, const basic_stacktrace<Allocator>& st);
1755+
ostream& operator<<(ostream& os, const stacktrace_entry& f);
1756+
template<class Allocator>
1757+
ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st);
17621758

17631759
namespace pmr {
17641760
using stacktrace = basic_stacktrace<polymorphic_allocator<stacktrace_entry>>;
@@ -2391,9 +2387,7 @@
23912387

23922388
\indexlibrarymember{operator<<}{stacktrace_entry}%
23932389
\begin{itemdecl}
2394-
template<class charT, class traits>
2395-
basic_ostream<charT, traits>&
2396-
operator<<(basic_ostream<charT, traits>& os, const stacktrace_entry& f);
2390+
ostream& operator<<(ostream& os, const stacktrace_entry& f);
23972391
\end{itemdecl}
23982392

23992393
\begin{itemdescr}
@@ -2404,9 +2398,8 @@
24042398

24052399
\indexlibrarymember{operator<<}{basic_stacktrace}%
24062400
\begin{itemdecl}
2407-
template<class charT, class traits, class Allocator>
2408-
basic_ostream<charT, traits>&
2409-
operator<<(basic_ostream<charT, traits>& os, const basic_stacktrace<Allocator>& st);
2401+
template<class Allocator>
2402+
ostream& operator<<(ostream& os, const basic_stacktrace<Allocator>& st);
24102403
\end{itemdecl}
24112404

24122405
\begin{itemdescr}

source/iostreams.tex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18327,12 +18327,6 @@
1832718327
\pnum
1832818328
\throws
1832918329
As specified in~\ref{fs.err.report}.
18330-
18331-
\pnum
18332-
\remarks
18333-
Implementations should
18334-
avoid unnecessary normalization such as
18335-
when \tcode{canonical} has already been called on the entirety of \tcode{p}.
1833618330
\end{itemdescr}
1833718331

1833818332
\rSec1[c.files]{C library files}

source/lib-intro.tex

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,14 @@
478478
implementation-defined types\iref{type.descriptions},
479479
and member functions\iref{functions.within.classes}.
480480

481-
\rSec3[expos.only.func]{Exposition-only functions}
481+
\rSec3[expos.only.entity]{Exposition-only entities, etc.}
482482

483483
\pnum
484-
Several function templates
484+
Several entities and \grammarterm{typedef-name}{s}
485485
defined in \ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr}
486486
are only defined for the purpose of exposition.
487-
The declaration of such a function is followed by a comment ending in \expos.
487+
The declaration of such an entity or \grammarterm{typedef-name}
488+
is followed by a comment ending in \expos.
488489

489490
\pnum
490491
The following are defined for exposition only
@@ -546,22 +547,6 @@
546547
\indextext{types!implementation-defined}%
547548
They are based on other types, but with added constraints.
548549

549-
\rSec4[expos.only.types]{Exposition-only types}
550-
551-
\pnum
552-
Several types defined in \ref{\firstlibchapter} through \ref{\lastlibchapter}
553-
and \ref{depr} are defined for the purpose of exposition.
554-
The declaration of such a type is followed by a comment ending in \expos.
555-
\begin{example}
556-
\begin{codeblock}
557-
namespace std {
558-
extern "C" using @\placeholdernc{some-handler}@ = int(int, void*, double); // \expos
559-
}
560-
\end{codeblock}
561-
The type placeholder \tcode{\placeholder{some-handler}} can now be used to specify a function
562-
that takes a callback parameter with C language linkage.
563-
\end{example}
564-
565550
\rSec4[enumerated.types]{Enumerated types}
566551

567552
\pnum
@@ -914,52 +899,70 @@
914899
\pnum
915900
An implementation may use any technique that provides equivalent observable behavior.
916901

917-
\rSec3[freestanding.entity]{Freestanding entities}
902+
\rSec3[freestanding.item]{Freestanding items}
918903

919904
\pnum
920-
\indextext{entity!freestanding|see{freestanding entity}}%
921-
A \defn{freestanding entity} is a declaration or macro definition
922-
that is present in a freestanding implementation and a hosted implementation.
905+
\indextext{item!freestanding|see{freestanding item}}%
906+
A \defn{freestanding item} is
907+
a declaration, entity, \grammarterm{typedef-name}, or macro
908+
that is required to be present in
909+
a freestanding implementation and a hosted implementation.
923910

924911
\pnum
925912
Unless otherwise specified,
926-
the requirements on freestanding entities on a freestanding implementation
927-
are the same as the corresponding requirements in a hosted implementation.
913+
the requirements on freestanding items for a freestanding implementation
914+
are the same as the corresponding requirements for a hosted implementation,
915+
except that not all of the members of the namespaces are required to be present.
916+
\begin{note}
917+
This implies that freestanding item enumerations have the same enumerators on
918+
freestanding implementations and hosted implementations.
919+
Furthermore, class types have the same members and
920+
class templates have the same deduction guides
921+
on freestanding implementations and hosted implementations.
922+
\end{note}
923+
924+
\pnum
925+
\indextext{declaration!freestanding item}%
926+
A declaration in a header synopsis is a freestanding item if
927+
\begin{itemize}
928+
\item it is followed by a comment that includes \textit{freestanding}, or
929+
\item the header synopsis begins with a comment that includes \textit{all freestanding}.
930+
\end{itemize}
931+
932+
\pnum
933+
\indextext{entity!freestanding item}%
934+
\indextext{\idxgram{typedef-name}!freestanding item}%
935+
An entity or \grammarterm{typedef-name} is a freestanding item if it is:
936+
\begin{itemize}
937+
\item introduced by a declaration that is a freestanding item,
938+
\item an enclosing namespace of a freestanding item,
939+
\item a friend of a freestanding item,
940+
\item denoted by a \grammarterm{typedef-name} that is a freestanding item, or
941+
\item denoted by an alias template that is a freestanding item.
942+
\end{itemize}
943+
944+
\pnum
945+
\indextext{macro!freestanding item}%
946+
A macro is a freestanding item if it is defined in a header synopsis and
947+
\begin{itemize}
948+
\item the definition is followed by a comment that includes \textit{freestanding}, or
949+
\item the header synopsis begins with a comment that includes \textit{all freestanding}.
950+
\end{itemize}
928951

929952
\pnum
930-
In a header synopsis, entities followed with a comment
931-
that includes \textit{freestanding} are freestanding entities.
932953
\begin{example}
933954
\begin{codeblock}
934955
#define NULL @\seebelow@ // freestanding
935956
\end{codeblock}
936957
\end{example}
937958

938-
\pnum
939-
If a header synopsis begins with a comment
940-
that includes \textit{all freestanding},
941-
then all of the declarations and macro definitions in the header synopsis
942-
are freestanding entities.
943959
\begin{example}
944960
\begin{codeblock}
945961
// all freestanding
946962
namespace std {
947963
\end{codeblock}
948964
\end{example}
949965

950-
\pnum
951-
Deduction guides for freestanding entity class templates are freestanding entities.
952-
953-
\pnum
954-
Enclosing namespaces of freestanding entities are freestanding entities.
955-
956-
\pnum
957-
Friends of freestanding entities are freestanding entities.
958-
959-
\pnum
960-
Entities denoted by freestanding entity \grammarterm{typedef-name}{s} and
961-
freestanding entity alias templates are freestanding entities.
962-
963966
\rSec1[requirements]{Library-wide requirements}
964967

965968
\rSec2[requirements.general]{General}
@@ -1480,7 +1483,7 @@
14801483
\pnum
14811484
For each of the headers listed in \tref{headers.cpp.fs},
14821485
a freestanding implementation provides at least
1483-
the freestanding entities\iref{freestanding.entity} declared in the header.
1486+
the freestanding items\iref{freestanding.item} declared in the header.
14841487
\indextext{implementation!freestanding|)}%
14851488

14861489
\pnum

source/memory.tex

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,22 @@
8686

8787
// \ref{obj.lifetime}, explicit lifetime management
8888
template<class T>
89-
T* start_lifetime_as(void* p) noexcept;
89+
T* start_lifetime_as(void* p) noexcept; // freestanding
9090
template<class T>
91-
const T* start_lifetime_as(const void* p) noexcept;
91+
const T* start_lifetime_as(const void* p) noexcept; // freestanding
9292
template<class T>
93-
volatile T* start_lifetime_as(volatile void* p) noexcept;
93+
volatile T* start_lifetime_as(volatile void* p) noexcept; // freestanding
9494
template<class T>
95-
const volatile T* start_lifetime_as(const volatile void* p) noexcept;
95+
const volatile T* start_lifetime_as(const volatile void* p) noexcept; // freestanding
9696
template<class T>
97-
T* start_lifetime_as_array(void* p, size_t n) noexcept;
97+
T* start_lifetime_as_array(void* p, size_t n) noexcept; // freestanding
9898
template<class T>
99-
const T* start_lifetime_as_array(const void* p, size_t n) noexcept;
99+
const T* start_lifetime_as_array(const void* p, size_t n) noexcept; // freestanding
100100
template<class T>
101-
volatile T* start_lifetime_as_array(volatile void* p, size_t n) noexcept;
101+
volatile T* start_lifetime_as_array(volatile void* p, size_t n) noexcept; // freestanding
102102
template<class T>
103-
const volatile T* start_lifetime_as_array(const volatile void* p, size_t n) noexcept;
103+
const volatile T* start_lifetime_as_array(const volatile void* p, // freestanding
104+
size_t n) noexcept;
104105

105106
// \ref{allocator.tag}, allocator argument tag
106107
struct allocator_arg_t { // freestanding

source/meta.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@
881881
\tcode{template<class T>}\br
882882
\tcode{struct is_aggregate;} &
883883
\tcode{T} is an aggregate type\iref{dcl.init.aggr} &
884-
\tcode{remove_all_extents_t<T>} shall be a complete type or \cv~\keyword{void}. \\ \rowsep
884+
\tcode{T} shall be an array type, a complete type, or \cv~\keyword{void}. \\ \rowsep
885885

886886
\indexlibrary{\idxcode{is_signed}!class}%
887887
\tcode{template<class T>}\br

0 commit comments

Comments
 (0)