Skip to content

Commit 65a7641

Browse files
committed
Merge 2016-02 LWG Motion 2
2 parents aa66e0d + 98c430e commit 65a7641

File tree

7 files changed

+125
-52
lines changed

7 files changed

+125
-52
lines changed

source/containers.tex

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,12 +2590,7 @@
25902590
\indextext{\idxcode{array}!initialization}%
25912591
\indextext{\idxcode{array}!as aggregate}%
25922592
An \tcode{array} is an aggregate~(\ref{dcl.init.aggr}) that can be
2593-
initialized with the syntax
2594-
\begin{codeblock}
2595-
array<T, N> a = { @\textit{initializer-list}@ };
2596-
\end{codeblock}
2597-
2598-
where \textit{initializer-list} is a comma-separated list of up
2593+
list-initialized with up
25992594
to \tcode{N} elements whose types are convertible to \tcode{T}.
26002595

26012596
\pnum
@@ -3708,9 +3703,7 @@
37083703
\pnum
37093704
\effects If \tcode{sz < distance(begin(), end())}, erases the last \tcode{distance(begin(),
37103705
end()) - sz} elements from the list. Otherwise, inserts \tcode{sz - distance(begin(), end())}
3711-
elements at the end of the list such that each new element, \tcode{e}, is initialized
3712-
by a method equivalent to calling
3713-
\tcode{allocator_traits<allocator_type>::construct(get_allocator(), std::addressof(e), c)}.
3706+
copies of \tcode{c} at the end of the list.
37143707

37153708
\pnum
37163709
\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}.
@@ -5794,8 +5787,6 @@
57945787
\begin{itemdecl}
57955788
template <class P> pair<iterator, bool> insert(P&& x);
57965789
template <class P> iterator insert(const_iterator position, P&& x);
5797-
template <class InputIterator>
5798-
void insert(InputIterator first, InputIterator last);
57995790
\end{itemdecl}
58005791

58015792
\begin{itemdescr}
@@ -8208,6 +8199,8 @@
82088199
of each adaptor. If the container takes an allocator, then a compatible allocator may be passed in
82098200
to the adaptor's constructor. Otherwise, normal copy or move construction is used for the container
82108201
argument.
8202+
The first template parameter \tcode{T} of the container adaptors
8203+
shall denote the same type as \tcode{Container::value_type}.
82118204

82128205
\pnum
82138206
For container adaptors, no \tcode{swap} function throws an exception unless that

source/diagnostics.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@
552552
is a constant subexpression~(\ref{defns.const.subexpr}), if
553553
\begin{itemize}
554554
\item
555-
\tcode{NDEBUG} is defined at the point where \tcode{assert(E)} appears, or
555+
\tcode{NDEBUG} is defined at the point where \tcode{assert}
556+
is last defined or redefined, or
556557
\item
557558
\tcode{E} contextually converted to \tcode{bool}~(Clause~\ref{conv})
558559
is a constant subexpression that evaluates to the value \tcode{true}.

source/iterators.tex

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,11 +2731,12 @@
27312731
\begin{itemdescr}
27322732
\pnum
27332733
\effects
2734-
Initializes \textit{in_stream} with \tcode{\&s}. \textit{value} may be initialized during
2734+
Initializes \textit{in_stream} with \tcode{addressof(s)}.
2735+
\textit{value} may be initialized during
27352736
construction or the first time it is referenced.
27362737

27372738
\pnum
2738-
\postcondition \tcode{in_stream == \&s}.
2739+
\postcondition \tcode{in_stream == addressof(s)}.
27392740
\end{itemdescr}
27402741

27412742

@@ -2787,7 +2788,7 @@
27872788
\begin{itemdescr}
27882789
\pnum
27892790
\returns
2790-
\tcode{\&(operator*())}.
2791+
\tcode{addressof(operator*())}.
27912792
\end{itemdescr}
27922793

27932794
\indexlibrary{\idxcode{operator++}!\idxcode{istream_iterator}}%
@@ -2925,7 +2926,8 @@
29252926
\begin{itemdescr}
29262927
\pnum
29272928
\effects
2928-
Initializes \textit{out_stream} with \tcode{\&s} and \textit{delim} with null.
2929+
Initializes \textit{out_stream} with \tcode{addressof(s)} and
2930+
\textit{delim} with null.
29292931
\end{itemdescr}
29302932

29312933

@@ -2937,7 +2939,8 @@
29372939
\begin{itemdescr}
29382940
\pnum
29392941
\effects
2940-
Initializes \textit{out_stream} with \tcode{\&s} and \textit{delim} with \tcode{delimiter}.
2942+
Initializes \textit{out_stream} with \tcode{addressof(s)} and
2943+
\textit{delim} with \tcode{delimiter}.
29412944
\end{itemdescr}
29422945

29432946

source/numerics.tex

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9063,6 +9063,33 @@
90639063
lldiv_t div(long long, long long); // \tcode{lldiv()}
90649064
\end{codeblock}
90659065

9066+
\pnum
9067+
To avoid ambiguities, \Cpp also adds the following overloads of \tcode{abs()}
9068+
to \tcode{<cstdlib>}, with the semantics defined in \tcode{<cmath>}:
9069+
\begin{codeblock}
9070+
float abs(float);
9071+
double abs(double);
9072+
long double abs(long double);
9073+
\end{codeblock}
9074+
9075+
\pnum
9076+
To avoid ambiguities, \Cpp also adds the following overloads of \tcode{abs()}
9077+
to \tcode{<cmath>}, with the semantics defined in \tcode{<cstdlib>}:
9078+
\begin{codeblock}
9079+
int abs(int);
9080+
long abs(long);
9081+
long long abs(long long);
9082+
\end{codeblock}
9083+
9084+
\pnum
9085+
If \tcode{abs()} is called with an argument of type \tcode{X}
9086+
for which \tcode{is_unsigned<X>::value} is \tcode{true} and
9087+
if \tcode{X} cannot be converted to \tcode{int}
9088+
by integral promotion~(\ref{conv.prom}), the program is ill-formed.
9089+
\enternote
9090+
Arguments that can be promoted to \tcode{int} are permitted for compatibility with C.
9091+
\exitnote
9092+
90669093
\pnum
90679094
In addition to the
90689095
\tcode{double}

source/strings.tex

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,9 @@
895895
explicit basic_string(const Allocator& a) noexcept;
896896
basic_string(const basic_string& str);
897897
basic_string(basic_string&& str) noexcept;
898-
basic_string(const basic_string& str, size_type pos, size_type n = npos,
898+
basic_string(const basic_string& str, size_type pos,
899+
const Allocator& a = Allocator());
900+
basic_string(const basic_string& str, size_type pos, size_type n,
899901
const Allocator& a = Allocator());
900902
basic_string(const charT* s,
901903
size_type n, const Allocator& a = Allocator());
@@ -1181,8 +1183,7 @@
11811183

11821184
\indexlibrary{\idxcode{basic_string}!constructor}%
11831185
\begin{itemdecl}
1184-
basic_string(const basic_string& str,
1185-
size_type pos, size_type n = npos,
1186+
basic_string(const basic_string& str, size_type pos,
11861187
const Allocator& a = Allocator());
11871188
\end{itemdecl}
11881189

@@ -1198,12 +1199,31 @@
11981199
Constructs an object of class
11991200
\tcode{basic_string}
12001201
and determines the effective length \tcode{rlen} of the initial string
1201-
value as the smaller of \tcode{n} and
1202-
\tcode{str.size() - pos},
1202+
value as \tcode{str.size() - pos},
1203+
as indicated in Table~\ref{tab:strings.ctr.2}.
1204+
\end{itemdescr}
1205+
1206+
\indexlibrary{\idxcode{basic_string}!constructor}%
1207+
\begin{itemdecl}
1208+
basic_string(const basic_string& str, size_type pos, size_type n,
1209+
const Allocator& a = Allocator());
1210+
\end{itemdecl}
1211+
1212+
\begin{itemdescr}
1213+
\pnum
1214+
\throws
1215+
\tcode{out_of_range} if \tcode{pos > str.size()}.
1216+
1217+
\pnum
1218+
\effects
1219+
Constructs an object of class \tcode{basic_string}
1220+
and determines the effective length \tcode{rlen} of the initial string
1221+
value as the smaller of \tcode{n} and \tcode{str.size() - pos},
12031222
as indicated in Table~\ref{tab:strings.ctr.2}.
12041223

12051224
\begin{libefftabvalue}
1206-
{\tcode{basic_string(const basic_string\&, size_type, size_type, const Allocator\&)} effects}
1225+
{\tcode{basic_string(const basic_string\&, size_type, const Allocator\&)}\protect\linebreak and
1226+
\tcode{basic_string(const basic_string\&, size_type, size_type, const Allocator\&)} effects}
12071227
{tab:strings.ctr.2}
12081228
\tcode{data()} &
12091229
points at the first element of an allocated copy of \tcode{rlen} consecutive elements
@@ -2043,7 +2063,7 @@
20432063

20442064
\begin{itemdescr}
20452065
\pnum
2046-
\effects Equivalent to \tcode{assign(str, 0, npos)}.
2066+
\effects Equivalent to \tcode{*this = str}.
20472067

20482068
\pnum
20492069
\returns

source/threads.tex

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@
18361836
\effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.lock()}.
18371837

18381838
\pnum
1839-
\postconditions \tcode{pm == \&m} and \tcode{owns == true}.
1839+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == true}.
18401840
\end{itemdescr}
18411841

18421842
\indexlibrary{\idxcode{unique_lock}!constructor}%
@@ -1849,7 +1849,7 @@
18491849
\effects Constructs an object of type \tcode{unique_lock}.
18501850

18511851
\pnum
1852-
\postconditions \tcode{pm == \&m} and \tcode{owns == false}.
1852+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == false}.
18531853
\end{itemdescr}
18541854

18551855
\indexlibrary{\idxcode{unique_lock}!constructor}%
@@ -1868,8 +1868,8 @@
18681868
\effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.try_lock()}.
18691869

18701870
\pnum
1871-
\postconditions \tcode{pm == \&m} and \tcode{owns == res}, where \tcode{res} is
1872-
the value returned by the call to \tcode{m.try_lock()}.
1871+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == res},
1872+
where \tcode{res} is the value returned by the call to \tcode{m.try_lock()}.
18731873
\end{itemdescr}
18741874

18751875
\indexlibrary{\idxcode{unique_lock}!constructor}%
@@ -1885,7 +1885,7 @@
18851885
\effects Constructs an object of type \tcode{unique_lock}.
18861886

18871887
\pnum
1888-
\postconditions \tcode{pm == \&m} and \tcode{owns == true}.
1888+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == true}.
18891889

18901890
\pnum
18911891
\throws Nothing.
@@ -1907,7 +1907,8 @@
19071907
\effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.try_lock_until(abs_time)}.
19081908

19091909
\pnum
1910-
\postconditions \tcode{pm == \&m} and \tcode{owns == res}, where \tcode{res} is
1910+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == res},
1911+
where \tcode{res} is
19111912
the value returned by the call to \tcode{m.try_lock_until(abs_time)}.
19121913
\end{itemdescr}
19131914

@@ -1926,7 +1927,8 @@
19261927
\effects Constructs an object of type \tcode{unique_lock} and calls \tcode{m.try_lock_for(rel_time)}.
19271928

19281929
\pnum
1929-
\postconditions \tcode{pm == \&m} and \tcode{owns == res}, where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}.
1930+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == res},
1931+
where \tcode{res} is the value returned by the call to \tcode{m.try_lock_for(rel_time)}.
19301932
\end{itemdescr}
19311933

19321934
\indexlibrary{\idxcode{unique_lock}!constructor}%
@@ -2264,7 +2266,7 @@
22642266
\effects Constructs an object of type \tcode{shared_lock} and calls \tcode{m.lock_shared()}.
22652267

22662268
\pnum
2267-
\postconditions \tcode{pm == \&m} and \tcode{owns == true}.
2269+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == true}.
22682270
\end{itemdescr}
22692271

22702272
\indexlibrary{\idxcode{shared_lock}!constructor}%
@@ -2277,7 +2279,7 @@
22772279
\effects Constructs an object of type \tcode{shared_lock}.
22782280

22792281
\pnum
2280-
\postconditions \tcode{pm == \&m} and \tcode{owns == false}.
2282+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == false}.
22812283
\end{itemdescr}
22822284

22832285
\indexlibrary{\idxcode{shared_lock}!constructor}%
@@ -2293,7 +2295,8 @@
22932295
\effects Constructs an object of type \tcode{shared_lock} and calls \tcode{m.try_lock_shared()}.
22942296

22952297
\pnum
2296-
\postconditions \tcode{pm == \&m} and \tcode{owns == res} where \tcode{res} is the
2298+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == res}
2299+
where \tcode{res} is the
22972300
value returned by the call to \tcode{m.try_lock_shared()}.
22982301
\end{itemdescr}
22992302

@@ -2310,7 +2313,7 @@
23102313
\effects Constructs an object of type \tcode{shared_lock}.
23112314

23122315
\pnum
2313-
\postconditions \tcode{pm == \&m} and \tcode{owns == true}.
2316+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == true}.
23142317
\end{itemdescr}
23152318

23162319
\indexlibrary{\idxcode{shared_lock}!constructor}%
@@ -2329,7 +2332,8 @@
23292332
\tcode{m.try_lock_shared_until(abs_time)}.
23302333

23312334
\pnum
2332-
\postconditions \tcode{pm == \&m} and \tcode{owns == res} where \tcode{res}
2335+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == res}
2336+
where \tcode{res}
23332337
is the value returned by the call to \tcode{m.try_lock_shared_until(abs_time)}.
23342338
\end{itemdescr}
23352339

@@ -2349,7 +2353,8 @@
23492353
\tcode{m.try_lock_shared_for(rel_time)}.
23502354

23512355
\pnum
2352-
\postconditions \tcode{pm == \&m} and \tcode{owns == res} where \tcode{res} is
2356+
\postconditions \tcode{pm == addressof(m)} and \tcode{owns == res}
2357+
where \tcode{res} is
23532358
the value returned by the call to \tcode{m.try_lock_shared_for(rel_time)}.
23542359
\end{itemdescr}
23552360

0 commit comments

Comments
 (0)