Skip to content

Commit 04617cb

Browse files
committed
Merge 2017-07 LWG Motion 31
2 parents ad96641 + 4a7bec4 commit 04617cb

File tree

7 files changed

+56
-40
lines changed

7 files changed

+56
-40
lines changed

source/algorithms.tex

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,19 @@
12941294
which describe the manner in which the execution of these algorithms may be
12951295
parallelized and the manner in which they apply the element access functions.
12961296

1297+
\pnum
1298+
If an object is modified by an element access function,
1299+
the algorithm will perform no other unsynchronized accesses to that object.
1300+
The modifying element access functions are those
1301+
which are specified as modifying the object in the relevant concept.
1302+
\begin{note}
1303+
For example,
1304+
\tcode{swap()}, \tcode{++}, \tcode{--}, \tcode{@=}, and assignments
1305+
modify the object.
1306+
For the assignment and \tcode{@=} operators,
1307+
only the left argument is modified.
1308+
\end{note}
1309+
12971310
\pnum
12981311
Unless otherwise stated, implementations may make arbitrary copies of elements
12991312
(with type \tcode{T}) from sequences where \tcode{is_trivially_copy_constructible_v<T>}
@@ -4977,7 +4990,7 @@
49774990

49784991
\pnum
49794992
\complexity
4980-
At most $N \log N$
4993+
At most $2N \log N$
49814994
comparisons, where
49824995
$N = \tcode{last - first}$.
49834996
\end{itemdescr}

source/containers.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9285,7 +9285,8 @@
92859285
void push(const value_type& x) { c.push_back(x); }
92869286
void push(value_type&& x) { c.push_back(std::move(x)); }
92879287
template <class... Args>
9288-
reference emplace(Args&&... args) { return c.emplace_back(std::forward<Args>(args)...); }
9288+
decltype(auto) emplace(Args&&... args)
9289+
{ return c.emplace_back(std::forward<Args>(args)...); }
92899290
void pop() { c.pop_front(); }
92909291
void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
92919292
{ using std::swap; swap(c, q.c); }
@@ -9841,7 +9842,8 @@
98419842
void push(const value_type& x) { c.push_back(x); }
98429843
void push(value_type&& x) { c.push_back(std::move(x)); }
98439844
template <class... Args>
9844-
reference emplace(Args&&... args) { return c.emplace_back(std::forward<Args>(args)...); }
9845+
decltype(auto) emplace(Args&&... args)
9846+
{ return c.emplace_back(std::forward<Args>(args)...); }
98459847
void pop() { c.pop_back(); }
98469848
void swap(stack& s) noexcept(is_nothrow_swappable_v<Container>)
98479849
{ using std::swap; swap(c, s.c); }

source/future.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,8 @@
21112111

21122112
\pnum
21132113
The behavior of a program that adds specializations for
2114-
\tcode{is_literal_type} or \tcode{is_literal_type_v} is undefined.
2114+
any of the templates defined in this subclause is undefined,
2115+
unless explicitly permitted by the specification of the corresponding template.
21152116

21162117
\rSec1[depr.iterator.primitives]{Deprecated iterator primitives}
21172118

source/iostreams.tex

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11451,7 +11451,7 @@
1145111451

1145211452
\begin{itemdescr}
1145311453
\pnum
11454-
\returns \tcode{pathstring}.
11454+
\returns \tcode{native()}.
1145511455

1145611456
\pnum
1145711457
\remarks Conversion, if any, is performed as specified
@@ -14313,25 +14313,22 @@
1431314313

1431414314
\begin{itemdescr}
1431514315
\pnum
14316-
Let \tcode{s1} and \tcode{s2} be \tcode{file_status}s, determined
14317-
as if by \tcode{status(p1)} and \tcode{status(p2)}, respectively.
14318-
14319-
\pnum
14320-
\effects Determines \tcode{s1} and \tcode{s2}.
14321-
If \tcode{(!exists(s1) \&\& !exists(s2)) || (is_other(s1) \&\& is_other(s2))}
14322-
an error is reported~(\ref{fs.err.report}).
14323-
14324-
\pnum
14325-
\returns \tcode{true}, if \tcode{s1 == s2} and \tcode{p1} and \tcode{p2} resolve to the same file
14316+
\returns \tcode{true}, if \tcode{p1} and \tcode{p2} resolve to the same file
1432614317
system entity, else \tcode{false}. The signature with argument \tcode{ec}
1432714318
returns \tcode{false} if an error occurs.
1432814319

1432914320
\pnum
1433014321
Two paths are considered to resolve to the same file system entity if two
14331-
candidate entities reside on the same device at the same location. This is
14322+
candidate entities reside on the same device at the same location.
14323+
\begin{note}
14324+
On POSIX platforms, this is
1433214325
determined as if by the values of the POSIX \tcode{stat} structure,
1433314326
obtained as if by \tcode{stat()} for the two paths, having equal \tcode{st_dev} values
1433414327
and equal \tcode{st_ino} values.
14328+
\end{note}
14329+
14330+
\pnum
14331+
\remarks \tcode{!exists(p1) || !exists(p2)} is an error.
1433514332

1433614333
\pnum
1433714334
\throws As specified in~\ref{fs.err.report}.

source/lib-intro.tex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@
19541954
\tcode{X u = std::move(a);} &
19551955
&
19561956
Shall not exit via an exception.\br
1957-
\postconditions \tcode{u} is equal to the prior value of \tcode{a}. & \\ \rowsep
1957+
\postconditions The value of \tcode{a} is unchanged and is equal to \tcode{u}. & \\ \rowsep
19581958

19591959
\tcode{X u(std::move(b));} &
19601960
&
@@ -2173,6 +2173,12 @@
21732173
must be prepared to work adequately with any user-supplied specialization
21742174
that meets the minimum requirements of this International Standard.}
21752175

2176+
\pnum
2177+
The behavior of a \Cpp program is undefined
2178+
if it declares an explicit or partial specialization
2179+
of any standard library variable template,
2180+
except where explicitly permitted by the specification of that variable template.
2181+
21762182
\pnum
21772183
The behavior of a \Cpp program is undefined if it declares
21782184
\begin{itemize}

source/numerics.tex

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,8 +1162,11 @@
11621162
\pnum
11631163
\returns
11641164
The complex natural (base-$e$) logarithm of \tcode{x}. For all \tcode{x},
1165-
\tcode{imag(log(x))} lies in the interval \crange{$-\pi$}{$\pi$}, and
1166-
when \tcode{x} is a negative real number, \tcode{imag(log(x))} is $\pi$.
1165+
\tcode{imag(log(x))} lies in the interval \crange{$-\pi$}{$\pi$}.
1166+
\begin{note}
1167+
The semantics of this function are intended to be the same in \Cpp
1168+
as they are for \tcode{clog} in C.
1169+
\end{note}
11671170

11681171
\pnum
11691172
\remarks
@@ -1240,8 +1243,10 @@
12401243
\returns
12411244
The complex square root of \tcode{x}, in the range of the right
12421245
half-plane.
1243-
If the argument is a negative real number, the
1244-
value returned lies on the positive imaginary axis.
1246+
\begin{note}
1247+
The semantics of this function are intended to be the same in \Cpp
1248+
as they are for \tcode{csqrt} in C.
1249+
\end{note}
12451250

12461251
\pnum
12471252
\remarks

source/utilities.tex

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@
133133
template <size_t I, class T> class tuple_element;
134134

135135
template <class T1, class T2> struct tuple_size<pair<T1, T2>>;
136-
template <class T1, class T2> struct tuple_element<0, pair<T1, T2>>;
137-
template <class T1, class T2> struct tuple_element<1, pair<T1, T2>>;
136+
template <size_t I, class T1, class T2> struct tuple_element<I, pair<T1, T2>>;
138137

139138
template<size_t I, class T1, class T2>
140139
constexpr tuple_element_t<I, pair<T1, T2>>& get(pair<T1, T2>&) noexcept;
@@ -1287,18 +1286,14 @@
12871286

12881287
\indexlibrary{\idxcode{tuple_element}}%
12891288
\begin{itemdecl}
1290-
tuple_element<0, pair<T1, T2>>::type
1289+
tuple_element<I, pair<T1, T2>>::type
12911290
\end{itemdecl}
12921291
\begin{itemdescr}
1293-
\pnum\textit{Value:} The type \tcode{T1}.
1294-
\end{itemdescr}
1292+
\pnum
1293+
\requires \tcode{I < 2}. The program is ill-formed if \tcode{I} is out of bounds.
12951294

1296-
\indexlibrary{\idxcode{tuple_element}}%
1297-
\begin{itemdecl}
1298-
tuple_element<1, pair<T1, T2>>::type
1299-
\end{itemdecl}
1300-
\begin{itemdescr}
1301-
\pnum\textit{Value:} The type T2.
1295+
\pnum
1296+
\textit{Value:} The type \tcode{T1} if \tcode{I == 0}, otherwise the type \tcode{T2}.
13021297
\end{itemdescr}
13031298

13041299
\indexlibrarymember{get}{pair}%
@@ -5030,6 +5025,7 @@
50305025
\begin{itemdescr}
50315026
\pnum
50325027
\requires \tcode{I < sizeof...(Types)}.
5028+
The program is ill-formed if \tcode{I} is out of bounds.
50335029

50345030
\pnum
50355031
\textit{Value:} The type $\tcode{T}_I$.
@@ -10494,8 +10490,8 @@
1049410490
long use_count() const noexcept;
1049510491
bool expired() const noexcept;
1049610492
shared_ptr<T> lock() const noexcept;
10497-
template<class U> bool owner_before(const shared_ptr<U>& b) const;
10498-
template<class U> bool owner_before(const weak_ptr<U>& b) const;
10493+
template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
10494+
template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
1049910495
};
1050010496

1050110497
template<class T> weak_ptr(shared_ptr<T>) -> weak_ptr<T>;
@@ -10654,8 +10650,8 @@
1065410650

1065510651
\indexlibrarymember{owner_before}{weak_ptr}%
1065610652
\begin{itemdecl}
10657-
template<class U> bool owner_before(const shared_ptr<U>& b) const;
10658-
template<class U> bool owner_before(const weak_ptr<U>& b) const;
10653+
template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
10654+
template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
1065910655
\end{itemdecl}
1066010656

1066110657
\begin{itemdescr}
@@ -11710,10 +11706,6 @@
1171011706
sets the value of the default memory resource pointer to \tcode{r},
1171111707
otherwise sets the default memory resource pointer to \tcode{new_delete_resource()}.
1171211708

11713-
\pnum
11714-
\postconditions
11715-
\tcode{get_default_resource() == r}.
11716-
1171711709
\pnum
1171811710
\returns
1171911711
The previous value of the default memory resource pointer.

0 commit comments

Comments
 (0)