Skip to content

Commit d027b53

Browse files
authored
Merge 2021-10 LWG Motion 1
P2450R0 C++ Standard Library Issues to be moved in Virtual Plenary, Oct. 2021
2 parents fd7b67f + 8753efa commit d027b53

File tree

12 files changed

+385
-174
lines changed

12 files changed

+385
-174
lines changed

source/algorithms.tex

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3939,17 +3939,24 @@
39393939

39403940
\pnum
39413941
\complexity
3942-
If the types of \tcode{first1}, \tcode{last1}, \tcode{first2}, and \tcode{last2}:
3942+
If
39433943
\begin{itemize}
39443944
\item
3945+
the types of \tcode{first1}, \tcode{last1}, \tcode{first2}, and \tcode{last2}
39453946
meet the
39463947
\oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}
3948+
and \tcode{last1 - first1 != last2 - first2}
39473949
for the overloads in namespace \tcode{std};
39483950
\item
3949-
pairwise model \libconcept{sized_sentinel_for}\iref{iterator.concept.sizedsentinel}
3950-
for the overloads in namespace \tcode{ranges},
3951+
the types of \tcode{first1}, \tcode{last1}, \tcode{first2}, and \tcode{last2}
3952+
pairwise model \libconcept{sized_sentinel_for}\iref{iterator.concept.sizedsentinel}
3953+
and \tcode{last1 - first1 != last2 - first2}
3954+
for the first overload in namespace \tcode{ranges},
3955+
\item
3956+
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range} and
3957+
\tcode{ranges::distance(r1) != ranges::distance(r2)}
3958+
for the second overload in namespace \tcode{ranges},
39513959
\end{itemize}
3952-
and \tcode{last1 - first1 != last2 - first2},
39533960
then no applications of the corresponding predicate and each projection;
39543961
otherwise,
39553962
\begin{itemize}
@@ -4054,9 +4061,17 @@
40544061
\complexity
40554062
No applications of the corresponding predicate and projections if:
40564063
\begin{itemize}
4064+
\item
4065+
for the first overload,
4066+
\begin{itemize}
40574067
\item \tcode{S1} and \tcode{I1} model \tcode{\libconcept{sized_sentinel_for}<S1, I1>},
40584068
\item \tcode{S2} and \tcode{I2} model \tcode{\libconcept{sized_sentinel_for}<S2, I2>}, and
4059-
\item \tcode{last1 - first1 != last2 - first2}.
4069+
\item \tcode{last1 - first1 != last2 - first2};
4070+
\end{itemize}
4071+
\item
4072+
for the second overload,
4073+
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range}, and
4074+
\tcode{ranges::distance(r1) != ranges::distance(r2)}.
40604075
\end{itemize}
40614076
Otherwise, exactly \tcode{last1 - first1} applications
40624077
of the corresponding predicate and projections

source/compatibility.tex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,16 @@
17731773
binary representation of the required template specializations of
17741774
\tcode{std::complex} may not be compatible with this revision of \Cpp{}.
17751775

1776+
\rSec2[diff.cpp03.locale]{\ref{localization}: localization library}
1777+
1778+
\diffref{facet.num.get.virtuals}
1779+
\change
1780+
The \tcode{num_get} facet recognizes hexadecimal floating point values.
1781+
\rationale
1782+
Required by new feature.
1783+
\effect
1784+
Valid \CppIII{} code may have different behavior in this revision of \Cpp{}.
1785+
17761786
\rSec2[diff.cpp03.input.output]{\ref{input.output}: input/output library}
17771787

17781788
\diffref{istream.sentry,ostream.sentry,iostate.flags}

source/concepts.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@
346346
template<class From, class To>
347347
concept @\deflibconcept{convertible_to}@ =
348348
is_convertible_v<From, To> &&
349-
requires(add_rvalue_reference_t<From> (&f)()) {
350-
static_cast<To>(f());
349+
requires {
350+
static_cast<To>(declval<From>());
351351
};
352352
\end{itemdecl}
353353

source/iostreams.tex

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6892,7 +6892,10 @@
68926892
Then, if \tcode{os.rdbuf()} is a
68936893
\tcode{basic_syncbuf<charT, traits, Allocator>*},
68946894
called \tcode{buf} for the purpose of exposition,
6895-
calls \tcode{buf->emit()}.
6895+
behaves as an unformatted output function\iref{ostream.unformatted}
6896+
of \tcode{os}.
6897+
After constructing a \tcode{sentry} object, calls \tcode{buf->emit()}.
6898+
If that call returns \tcode{false}, calls \tcode{os.setstate(ios_base::badbit)}.
68966899

68976900
\pnum
68986901
\returns
@@ -11913,7 +11916,7 @@
1191311916

1191411917
\indexlibrarymember{operator=}{basic_syncbuf}%
1191511918
\begin{itemdecl}
11916-
basic_syncbuf& operator=(basic_syncbuf&& rhs) noexcept;
11919+
basic_syncbuf& operator=(basic_syncbuf&& rhs);
1191711920
\end{itemdecl}
1191811921

1191911922
\begin{itemdescr}
@@ -11951,7 +11954,7 @@
1195111954

1195211955
\indexlibrarymember{swap}{basic_syncbuf}%
1195311956
\begin{itemdecl}
11954-
void swap(basic_syncbuf& other) noexcept;
11957+
void swap(basic_syncbuf& other);
1195511958
\end{itemdecl}
1195611959

1195711960
\begin{itemdescr}
@@ -12079,7 +12082,7 @@
1207912082
\begin{itemdecl}
1208012083
template<class charT, class traits, class Allocator>
1208112084
void swap(basic_syncbuf<charT, traits, Allocator>& a,
12082-
basic_syncbuf<charT, traits, Allocator>& b) noexcept;
12085+
basic_syncbuf<charT, traits, Allocator>& b);
1208312086
\end{itemdecl}
1208412087

1208512088
\begin{itemdescr}
@@ -12215,7 +12218,8 @@
1221512218
\begin{itemdescr}
1221612219
\pnum
1221712220
\effects
12218-
Calls \tcode{sb.emit()}.
12221+
Behaves as an unformatted output function\iref{ostream.unformatted}.
12222+
After constructing a sentry object, calls \tcode{sb.emit()}.
1221912223
If that call returns \tcode{false},
1222012224
calls \tcode{setstate(ios_base::badbit)}.
1222112225

@@ -12468,14 +12472,14 @@
1246812472

1246912473
// \ref{fs.dir.itr.nonmembers}, range access for directory iterators
1247012474
directory_iterator begin(directory_iterator iter) noexcept;
12471-
directory_iterator end(const directory_iterator&) noexcept;
12475+
directory_iterator end(directory_iterator) noexcept;
1247212476

1247312477
// \ref{fs.class.rec.dir.itr}, recursive directory iterators
1247412478
class recursive_directory_iterator;
1247512479

1247612480
// \ref{fs.rec.dir.itr.nonmembers}, range access for recursive directory iterators
1247712481
recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
12478-
recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
12482+
recursive_directory_iterator end(recursive_directory_iterator) noexcept;
1247912483

1248012484
// \ref{fs.class.file.status}, file status
1248112485
class file_status;
@@ -12645,6 +12649,18 @@
1264512649
path weakly_canonical(const path& p);
1264612650
path weakly_canonical(const path& p, error_code& ec);
1264712651
}
12652+
12653+
namespace std::ranges {
12654+
template<>
12655+
inline constexpr bool enable_borrowed_range<filesystem::directory_iterator> = true;
12656+
template<>
12657+
inline constexpr bool enable_borrowed_range<filesystem::recursive_directory_iterator> = true;
12658+
12659+
template<>
12660+
inline constexpr bool enable_view<filesystem::directory_iterator> = true;
12661+
template<>
12662+
inline constexpr bool enable_view<filesystem::recursive_directory_iterator> = true;
12663+
}
1264812664
\end{codeblock}
1264912665

1265012666
\pnum
@@ -15774,7 +15790,7 @@
1577415790

1577515791
\indexlibrarymember{end}{directory_iterator}%
1577615792
\begin{itemdecl}
15777-
directory_iterator end(const directory_iterator&) noexcept;
15793+
directory_iterator end(directory_iterator) noexcept;
1577815794
\end{itemdecl}
1577915795

1578015796
\begin{itemdescr}
@@ -16145,7 +16161,7 @@
1614516161

1614616162
\indexlibrarymember{end}{recursive_directory_iterator}%
1614716163
\begin{itemdecl}
16148-
recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
16164+
recursive_directory_iterator end(recursive_directory_iterator) noexcept;
1614916165
\end{itemdecl}
1615016166

1615116167
\begin{itemdescr}

0 commit comments

Comments
 (0)