Skip to content

Commit ddb2fc2

Browse files
committed
fixup: paper transcription errors
1 parent 0cb6474 commit ddb2fc2

File tree

4 files changed

+56
-47
lines changed

4 files changed

+56
-47
lines changed

source/containers.tex

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@
945945
but specialized allocators can choose a different definition.
946946
\end{note}
947947

948+
\pnum
948949
The following exposition-only concept is used in the definition of containers:
949950
\begin{codeblock}
950951
template<class R, class T>
@@ -1719,6 +1720,7 @@
17191720
\tcode{\libconcept{assignable_from}<T\&, ranges::range_reference_t<R>>}
17201721
is modeled.
17211722

1723+
\pnum
17221724
\expects
17231725
\tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X}
17241726
from \tcode{*ranges::begin(rg)}.
@@ -1990,7 +1992,7 @@
19901992
\pnum
19911993
\expects
19921994
\tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X}
1993-
from \tcode{ranges::begin(rg)}.
1995+
from \tcode{*ranges::begin(rg)}.
19941996

19951997
\pnum
19961998
\effects
@@ -2072,7 +2074,10 @@
20722074
\pnum
20732075
\expects
20742076
\tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X}
2075-
from \tcode{ranges::begin(rg)}.
2077+
from \tcode{*ranges::begin(rg)}.
2078+
For \tcode{vector},
2079+
\tcode{T} is also
2080+
\oldconcept{MoveInsertable} into \tcode{X}.
20762081

20772082
\pnum
20782083
\effects
@@ -2620,7 +2625,7 @@
26202625
\range{i}{j} denotes a valid range,
26212626
\item
26222627
\tcode{rg} denotes a value of a type \tcode{R}
2623-
that models \exposconcept{container-compatible-range<value_type>},
2628+
that models \tcode{\exposconcept{container-compatible-range}<value_type>},
26242629
\item
26252630
\tcode{p} denotes a valid constant iterator to \tcode{a},
26262631
\item
@@ -2925,7 +2930,7 @@
29252930

29262931
\pnum
29272932
\complexity
2928-
same as \tcode{X(from_range, rg, c)}
2933+
Same as \tcode{X(from_range, rg, c)}.
29292934
\end{itemdescr}
29302935

29312936
\indexlibraryctor{set}%
@@ -6642,7 +6647,7 @@
66426647

66436648
\indexlibraryctor{deque}%
66446649
\begin{itemdecl}
6645-
template<@\libconcept{container-compatible-range}@<T> R>
6650+
template<@\exposconcept{container-compatible-range}@<T> R>
66466651
deque(from_range_t, R&& rg, const Allocator& = Allocator());
66476652
\end{itemdecl}
66486653

@@ -7112,7 +7117,7 @@
71127117
\indexlibraryctor{forward_list}%
71137118
\begin{itemdecl}
71147119
template<@\exposconcept{container-compatible-range}@<T> R>
7115-
forward_list(from_range_t, R&& rg, const Allocator& = Allocator());
7120+
forward_list(from_range_t, R&& rg, const Allocator& = Allocator());
71167121
\end{itemdecl}
71177122

71187123
\begin{itemdescr}
@@ -7301,7 +7306,7 @@
73017306
\pnum
73027307
\expects
73037308
\tcode{position} is \tcode{before_begin()} or
7304-
is a dereferenceable iterator in the range [begin(), end()).
7309+
is a dereferenceable iterator in the range \range{begin()}{end()}.
73057310
\tcode{rg} and \tcode{*this} do not overlap.
73067311

73077312
\pnum
@@ -8008,7 +8013,7 @@
80088013
\begin{itemdescr}
80098014
\pnum
80108015
\effects
8011-
Constructs a list object with the elements of the range \tcode{rg}.
8016+
Constructs a \tcode{list} object with the elements of the range \tcode{rg}.
80128017

80138018
\pnum
80148019
\complexity
@@ -8505,7 +8510,7 @@
85058510
and, for an element type other than \tcode{bool},
85068511
of a contiguous container\iref{container.requirements.general}.
85078512
The exceptions are the
8508-
\tcode{push_front}, \tcode{pop_front}, and \tcode{emplace_front} member functions, which are not
8513+
\tcode{push_front}, \tcode{prepend_range}, \tcode{pop_front}, and \tcode{emplace_front} member functions, which are not
85098514
provided. Descriptions are provided here only for operations on \tcode{vector}
85108515
that are not described in one of these tables or for operations where there is
85118516
additional semantic information.
@@ -8756,7 +8761,7 @@
87568761
from the results of dereferencing successive iterators of \tcode{rg},
87578762
where $N$ is \tcode{ranges::distance(rg)}.
87588763
Performs no reallocations if \tcode{R} models
8759-
ranges::\libconcept{forward_range} or ranges::\libconcept{sized_range};
8764+
\tcode{ranges::\libconcept{forward_range}} or \tcode{ranges::\libconcept{sized_range}};
87608765
otherwise, performs order $\log N$ reallocations and
87618766
order $N$ calls to the copy or move constructor of \tcode{T}.
87628767
\end{itemdescr}
@@ -10090,7 +10095,7 @@
1009010095
multimap(InputIterator first, InputIterator last,
1009110096
const Compare& comp = Compare(),
1009210097
const Allocator& = Allocator());
10093-
template<@\exposid{container-compatible-range}@<value_type> R>
10098+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1009410099
multimap(from_range_t, R&& rg,
1009510100
const Compare& comp = Compare(), const Allocator& = Allocator());
1009610101
multimap(const multimap& x);
@@ -10627,14 +10632,14 @@
1062710632

1062810633
\indexlibraryctor{set}%
1062910634
\begin{itemdecl}
10630-
template<@\exposid{container-compatible-range}@<value_type> R>
10635+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1063110636
set(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator());
1063210637
\end{itemdecl}
1063310638

1063410639
\begin{itemdescr}
1063510640
\pnum
1063610641
\effects
10637-
Constructs an empty set using the specified comparison object and allocator,
10642+
Constructs an empty \tcode{set} using the specified comparison object and allocator,
1063810643
and inserts elements from the range \tcode{rg}.
1063910644

1064010645
\pnum
@@ -10743,7 +10748,7 @@
1074310748
template<class InputIterator>
1074410749
multiset(InputIterator first, InputIterator last,
1074510750
const Compare& comp = Compare(), const Allocator& = Allocator());
10746-
template<@\exposid{container-compatible-range}@<value_type> R>
10751+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1074710752
multiset(from_range_t, R&& rg,
1074810753
const Compare& comp = Compare(), const Allocator& = Allocator());
1074910754
multiset(const multiset& x);
@@ -10799,7 +10804,7 @@
1079910804
iterator insert(const_iterator position, value_type&& x);
1080010805
template<class InputIterator>
1080110806
void insert(InputIterator first, InputIterator last);
10802-
template<@\exposid{container-compatible-range}@<value_type> R>
10807+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1080310808
void insert_range(R&& rg);
1080410809
void insert(initializer_list<value_type>);
1080510810

@@ -11232,10 +11237,10 @@
1123211237
unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf,
1123311238
const allocator_type& a)
1123411239
: unordered_map(f, l, n, hf, key_equal(), a) { }
11235-
template<@\libconcept{container-compatible-range}@<value_type> R>
11240+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1123611241
unordered_map(from_range_t, R&& rg, size_type n, const allocator_type& a)
1123711242
: unordered_map(from_range, std::forward<R>(rg), n, hasher(), key_equal(), a) { }
11238-
template<@\libconcept{container-compatible-range}@<value_type> R>
11243+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1123911244
unordered_map(from_range_t, R&& rg, size_type n, const hasher& hf, const allocator_type& a)
1124011245
: unordered_map(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { }
1124111246
unordered_map(initializer_list<value_type> il, size_type n, const allocator_type& a)
@@ -11275,7 +11280,7 @@
1127511280
iterator insert(const_iterator hint, value_type&& obj);
1127611281
template<class P> iterator insert(const_iterator hint, P&& obj);
1127711282
template<class InputIterator> void insert(InputIterator first, InputIterator last);
11278-
template<@\libconcept{container-compatible-range}@<value_type> R>
11283+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1127911284
void insert_range(R&& rg);
1128011285
void insert(initializer_list<value_type>);
1128111286

@@ -11414,7 +11419,7 @@
1141411419
equal_to<@\placeholder{iter-key-type}@<InputIterator>>, Allocator>;
1141511420

1141611421
template<ranges::\tcode{input_range} R, class Allocator>
11417-
unordered_map(from_range_t, R&&, typename see below::size_type, Allocator)
11422+
unordered_map(from_range_t, R&&, typename @\seebelow@::size_type, Allocator)
1141811423
-> unordered_map<@\exposid{range-key-type}@<R>, @\exposid{range-mapped-type}@<R>, hash<@\exposid{range-key-type}@<R>>,
1141911424
equal_to<@\exposid{range-key-type}@<R>>, Allocator>;
1142011425

@@ -12413,7 +12418,7 @@
1241312418
-> unordered_set<@\placeholder{iter-value-type}@<InputIterator>,
1241412419
Hash, Pred, Allocator>;
1241512420

12416-
template<ranges::input_range R,
12421+
template<ranges::@\libconcept{input_range}@ R,
1241712422
class Hash = hash<ranges::range_value_t<R>>,
1241812423
class Pred = equal_to<ranges::range_value_t<R>>,
1241912424
class Allocator = allocator<ranges::range_value_t<R>>>
@@ -12633,7 +12638,7 @@
1263312638
const hasher& hf = hasher(),
1263412639
const key_equal& eql = key_equal(),
1263512640
const allocator_type& a = allocator_type());
12636-
template<container-compatible-range<value_type> R>
12641+
template<@\exposconcept{container-compatible-range}@<value_type> R>
1263712642
unordered_multiset(from_range_t, R&& rg,
1263812643
size_type n = @\seebelow@,
1263912644
const hasher& hf = hasher(),
@@ -12786,7 +12791,7 @@
1278612791
-> unordered_multiset<@\placeholder{iter-value-type}@<InputIterator>,
1278712792
Hash, Pred, Allocator>;
1278812793

12789-
template<ranges::input_range R,
12794+
template<ranges::@\libconcept{input_range}@ R,
1279012795
class Hash = hash<ranges::range_value_t<R>>,
1279112796
class Pred = equal_to<ranges::range_value_t<R>>,
1279212797
class Allocator = allocator<ranges::range_value_t<R>>>
@@ -12824,7 +12829,7 @@
1282412829
-> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
1282512830
equal_to<ranges::range_value_t<R>>, Allocator>;
1282612831

12827-
template<ranges::input_range R, class Hash, class Allocator>
12832+
template<ranges::@\libconcept{input_range}@ R, class Hash, class Allocator>
1282812833
unordered_multiset(from_range_t, R&&, typename @\seebelow@::size_type, Hash, Allocator)
1282912834
-> unordered_multiset<ranges::range_value_t<R>, Hash, equal_to<ranges::range_value_t<R>>,
1283012835
Allocator>;
@@ -13102,6 +13107,7 @@
1310213107
queue(InputIterator first, InputIterator last, const Alloc&);
1310313108
template<@\exposconcept{container-compatible-range}@<T> R, class Alloc>
1310413109
queue(from_range_t, R&& rg, const Alloc&);
13110+
1310513111
[[nodiscard]] bool empty() const { return c.empty(); }
1310613112
size_type size() const { return c.size(); }
1310713113
reference front() { return c.front(); }
@@ -13301,7 +13307,7 @@
1330113307
\effects
1330213308
Equivalent to \tcode{c.append_range(std::forward<R>(rg))}
1330313309
if that is a valid expression,
13304-
otherwise \tcode{ranges::copy(rg, back_inserter(c));}
13310+
otherwise \tcode{ranges::copy(rg, back_inserter(c))}.
1330513311
\end{itemdescr}
1330613312

1330713313
\rSec3[queue.ops]{Operators}
@@ -13803,7 +13809,7 @@
1380313809

1380413810
\indexlibraryctor{priority_queue}%
1380513811
\begin{itemdecl}
13806-
template<container-compatible-range<T> R, class Alloc>
13812+
template<@\exposconcept{container-compatible-range}@<T> R, class Alloc>
1380713813
priority_queue(from_range_t, R&& rg, const Alloc& a);
1380813814
\end{itemdecl}
1380913815

@@ -14164,7 +14170,7 @@
1416414170
\effects
1416514171
Equivalent to \tcode{c.append_range(std::forward<R>(rg))}
1416614172
if that is a valid expression,
14167-
otherwise \tcode{ranges::copy(rg, back_inserter(c));}
14173+
otherwise \tcode{ranges::copy(rg, back_inserter(c))}.
1416814174
\end{itemdescr}
1416914175

1417014176
\rSec3[stack.ops]{Operators}

source/ranges.tex

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@
139139
template<@\libconcept{range}@ R>
140140
using borrowed_subrange_t = @\seebelow@;
141141

142+
// \ref{range.utility.conv}, range conversions
143+
template<class C, @\libconcept{input_range}@ R, class... Args> requires (!@\libconcept{view}@<C>)
144+
constexpr C to(R&& r, Args&&... args);
145+
template<template<class...> class C, @\libconcept{input_range}@ R, class... Args>
146+
constexpr auto to(R&& r, Args&&... args) -> @\seebelow@;
147+
template<class C, class... Args> requires (!@\libconcept{view}@<C>)
148+
constexpr auto to(Args&&... args) -> @\seebelow@;
149+
template<template<class...> class C, class... Args>
150+
constexpr auto to(Args&&... args) -> @\seebelow@;
151+
142152
// \ref{range.empty}, empty view
143153
template<class T>
144154
requires is_object_v<T>
@@ -330,15 +340,6 @@
330340
inline constexpr auto @\libmember{values}{views}@ = elements<1>;
331341
}
332342

333-
template<class C, @\libconcept{input_range}@ R, class... Args> requires (!@\libconcept{view}@<C>)
334-
constexpr C to(R&& r, Args&&... args);
335-
template<template<class...> class C, @\libconcept{input_range}@ R, class... Args>
336-
constexpr auto to(R && r, Args&&... args) -> @\seebelow@;
337-
template<class C, class... Args> requires (!@\exposid{view}@<C>)
338-
constexpr auto to(Args&&... args) -> @\seebelow@;
339-
template<template<class...> class C, class... Args>
340-
constexpr auto to(Args&&... args) -> @\seebelow@;
341-
342343
// \ref{range.zip}, zip view
343344
template<@\libconcept{input_range}@... Views>
344345
requires (@\libconcept{view}@<Views> && ...) && (sizeof...(Views) > 0)
@@ -2019,7 +2020,7 @@
20192020
\begin{codeblock}
20202021
string_view str = "the quick brown fox";
20212022
auto words = views::split(str, ' ') | to<vector<string>>();
2022-
// \tcode{words} is vector<string>{"the", "quick", "brown", "fox"}
2023+
// \tcode{words} is \tcode{vector<string>\{"the", "quick", "brown", "fox"\}}
20232024
\end{codeblock}
20242025
\end{example}
20252026

@@ -2028,7 +2029,7 @@
20282029
\begin{codeblock}
20292030
template<class Container>
20302031
constexpr bool @\exposid{reservable-container}@ = // \expos
2031-
sized_range<Container> &&
2032+
@\libconcept{sized_range}@<Container> &&
20322033
requires(Container& c, range_size_t<Container> n) {
20332034
c.reserve(n);
20342035
{ c.capacity() } -> @\libconcept{same_as}@<decltype(n)>;
@@ -2042,16 +2043,16 @@
20422043
template<class Container, class Ref>
20432044
constexpr bool @\exposid{container-insertable}@ = // \expos
20442045
requires(Container& c, Ref&& ref) {
2045-
requires (requires { c.push_back(std::forward<Ref>(ref)); } ||
2046-
requires { c.insert(c.end(), std::forward<Ref>(ref)); });
2046+
requires (requires { c.push_back(std::forward<Ref>(ref)); } ||
2047+
requires { c.insert(c.end(), std::forward<Ref>(ref)); });
20472048
};
20482049
\end{codeblock}
20492050

20502051
\pnum
20512052
Let \exposid{container-inserter} be defined as follows:
20522053
\begin{codeblock}
20532054
template<typename Ref>
2054-
auto @\exposid{container-inserter}@(C & c) { // \expos
2055+
auto @\exposid{container-inserter}@(C& c) { // \expos
20552056
if constexpr (requires { c.push_back(declval<Ref>()); })
20562057
return back_inserter(c);
20572058
else
@@ -2068,6 +2069,7 @@
20682069
\end{itemdecl}
20692070

20702071
\begin{itemdescr}
2072+
\pnum
20712073
\returns
20722074
An object of type \tcode{C}
20732075
constructed from the elements of \tcode{r} in the following manner:
@@ -2100,7 +2102,7 @@
21002102
is \tcode{true}:
21012103
\end{itemize}
21022104
\begin{codeblock}
2103-
C(ranges::begin(r), ranges::end(r), std::forward<Args>(args)...);
2105+
C(ranges::begin(r), ranges::end(r), std::forward<Args>(args)...)
21042106
\end{codeblock}
21052107
\item
21062108
Otherwise, if
@@ -2122,7 +2124,7 @@
21222124
Otherwise,
21232125
if \tcode{\libconcept{input_range}<range_reference_t<R>>} is \tcode{true}:
21242126
\begin{codeblock}
2125-
to<C>(r | views::transform([](auto &&elem) {
2127+
to<C>(r | views::transform([](auto&& elem) {
21262128
return to<range_value_t<C>>(std::forward<decltype(elem)>(elem));
21272129
}), std::forward<Args>(args)...);
21282130
\end{codeblock}
@@ -2142,7 +2144,7 @@
21422144
\pnum
21432145
Let \exposid{input-iterator} be an exposition-only type:
21442146
\begin{codeblock}
2145-
struct @\exposid{input-iterator}@ { //\expos
2147+
struct @\exposid{input-iterator}@ { // \expos
21462148
using iterator_category = input_iterator_tag;
21472149
using value_type = range_value_t<R>;
21482150
using difference_type = ptrdiff_t;
@@ -2183,7 +2185,7 @@
21832185
\tcode{to<decltype(\placeholder{DEDUCE_EXPR})>(std::forward<R>(r), std::forward<Args>(args)...)}.
21842186
\end{itemdescr}
21852187

2186-
\rSec3[range.utility.conv.adapters]{\tcode{ranges::to} adaptors}
2188+
\rSec3[range.utility.conv.adaptors]{\tcode{ranges::to} adaptors}
21872189

21882190
\indexlibrarymember{to}{ranges}%
21892191
\begin{itemdecl}

source/strings.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,11 +907,11 @@
907907
constexpr basic_string& append(size_type n, charT c);
908908
template<class InputIterator>
909909
constexpr basic_string& append(InputIterator first, InputIterator last);
910+
template<@\exposconcept{container-compatible-range}@<charT> R>
911+
constexpr basic_string& append_range(R&& rg);
910912
constexpr basic_string& append(initializer_list<charT>);
911913

912914
constexpr void push_back(charT c);
913-
template<@\exposconcept{container-compatible-range}@<charT> R>
914-
constexpr basic_string& append_range(R&& rg);
915915

916916
constexpr basic_string& assign(const basic_string& str);
917917
constexpr basic_string& assign(basic_string&& str)

source/support.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,8 @@
602602
#define @\defnlibxname{cpp_lib_constexpr_utility}@ 201811L // also in \libheader{utility}
603603
#define @\defnlibxname{cpp_lib_constexpr_vector}@ 201907L // also in \libheader{vector}
604604
#define @\defnlibxname{cpp_lib_containers_ranges}@ 202202L
605-
// also in \libheader{vector}, \libheader{list}, \libheader{forward_list}, \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}, \libheader{deque}, \libheader{queue}, \libheader{priority_queue}, \libheader{stack}, \libheader{string}
605+
// also in \libheader{vector}, \libheader{list}, \libheader{forward_list}, \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set},
606+
// \libheader{deque}, \libheader{queue}, \libheader{priority_queue}, \libheader{stack}, \libheader{string}
606607
#define @\defnlibxname{cpp_lib_coroutine}@ 201902L // also in \libheader{coroutine}
607608
#define @\defnlibxname{cpp_lib_destroying_delete}@ 201806L // also in \libheader{new}
608609
#define @\defnlibxname{cpp_lib_enable_shared_from_this}@ 201603L // also in \libheader{memory}

0 commit comments

Comments
 (0)