Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
28e1f33
LWG3767 codecvt<charN_t, char8_t, mbstate_t> incorrectly added to locale
burblebee Mar 28, 2024
6601cd8
LWG3919 enumerate_view may invoke UB for sized common non-forward und…
burblebee Mar 28, 2024
480d145
LWG3950 std::basic_string_view comparison operators are overspecified
burblebee Mar 28, 2024
145cd72
LWG3975 Specializations of basic_format_context should not be permitted
burblebee Mar 28, 2024
775f20d
LWG3984 ranges::to's recursion branch may be ill-formed
burblebee Mar 29, 2024
0b0c388
LWG4011 "Effects: Equivalent to return" in [span.elem]
burblebee Mar 29, 2024
010df13
LWG4012 common_view::begin/end are missing the simple-view check
burblebee Mar 29, 2024
7b98d2f
LWG4013 lazy_split_view::outer-iterator::value_type should not provid…
burblebee Mar 29, 2024
1958e50
LWG4016 container-insertable checks do not match what container-inser…
burblebee Mar 29, 2024
9392d9c
LWG4023 Preconditions of std::basic_streambuf::setg/setp
burblebee Mar 29, 2024
76b5aab
LWG4025 Move assignment operator of std::expected<cv void, E> should …
burblebee Mar 29, 2024
97e9077
LWG4030 Clarify whether arithmetic expressions in [numeric.sat.func] …
burblebee Mar 29, 2024
8c99744
LWG4031 bad_expected_access<void> member functions should be noexcept
burblebee Mar 29, 2024
48e3185
LWG4035 single_view should provide empty
burblebee Mar 29, 2024
213e8ba
LWG4036 __alignof_is_defined is only implicitly specified in C++ and …
burblebee Mar 29, 2024
6672329
LWG4037 Static data members of ctype_base are not yet required to be …
burblebee Mar 29, 2024
09a02ba
LWG4038 std::text_encoding::aliases_view should have constexpr iterators
burblebee Mar 29, 2024
f78d268
LWG4043 "ASCII" is not a registered character encoding
burblebee Mar 29, 2024
99b3b24
LWG4045 tuple can create dangling references from tuple-like
burblebee Mar 29, 2024
25e39c4
LWG4053 Unary call to std::views::repeat does not decay the argument
burblebee Mar 29, 2024
d72daf7
LWG4054 Repeating a repeat_view should repeat the view
burblebee Mar 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10773,11 +10773,9 @@
\rSec3[numeric.sat.func]{Arithmetic functions}

\pnum
\begin{note}
In the following descriptions, an arithmetic operation
is performed as a mathematical operation with infinite range and then
it is determined whether the mathematical result fits into the result type.
\end{note}

\indexlibraryglobal{add_sat}%
\begin{itemdecl}
Expand Down
28 changes: 20 additions & 8 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18837,8 +18837,12 @@
\tcode{idx < size()} is \tcode{true}.

\pnum
\effects
Equivalent to: \tcode{return *(data() + idx);}
\returns
\tcode{*(data() + idx)}.

\pnum
\throws
Nothing.
\end{itemdescr}

\indexlibrarymember{span}{at}%
Expand Down Expand Up @@ -18867,8 +18871,12 @@
\tcode{empty()} is \tcode{false}.

\pnum
\effects
Equivalent to: \tcode{return *data();}
\returns
\tcode{*data()}.

\pnum
\throws
Nothing.
\end{itemdescr}

\indexlibrarymember{span}{back}%
Expand All @@ -18882,8 +18890,12 @@
\tcode{empty()} is \tcode{false}.

\pnum
\effects
Equivalent to: \tcode{return *(data() + (size() - 1));}
\returns
\tcode{*(data() + (size() - 1))}.

\pnum
\throws
Nothing.
\end{itemdescr}

\indexlibrarymember{span}{data}%
Expand All @@ -18893,8 +18905,8 @@

\begin{itemdescr}
\pnum
\effects
Equivalent to: \tcode{return \exposid{data_};}
\returns
\exposid{data_}.
\end{itemdescr}

\rSec4[span.iterators]{Iterator support}
Expand Down
15 changes: 11 additions & 4 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
\indexlibraryglobal{__alignas_is_defined}%
\begin{codeblock}
#define @\xname{alignas_is_defined}@ 1
#define @\xname{alignof_is_defined}@ 1
\end{codeblock}

\pnum
Expand Down Expand Up @@ -2410,6 +2411,8 @@
\begin{codeblock}
codecvt<char16_t, char, mbstate_t>
codecvt<char32_t, char, mbstate_t>
codecvt<char16_t, char8_t, mbstate_t>
codecvt<char32_t, char8_t, mbstate_t>
\end{codeblock}

\pnum
Expand All @@ -2420,18 +2423,22 @@
\begin{codeblock}
codecvt_byname<char16_t, char, mbstate_t>
codecvt_byname<char32_t, char, mbstate_t>
codecvt_byname<char16_t, char8_t, mbstate_t>
codecvt_byname<char32_t, char8_t, mbstate_t>
\end{codeblock}

\pnum
The following class template specializations are required
in addition to those specified in~\ref{locale.codecvt}.
\indextext{UTF-8}%
\indextext{UTF-16}%
The specialization \tcode{codecvt<char16_t, char, mbstate_t>}
converts between the UTF-16 and UTF-8 encoding forms, and
The specializations \tcode{codecvt<char16_t, char, mbstate_t>} and
\tcode{codecvt<char16_t, char8_t, mbstate_t>}
convert between the UTF-16 and UTF-8 encoding forms, and
\indextext{UTF-32}%
the specialization \tcode{codecvt<char32_t, char, mbstate_t>}
converts between the UTF-32 and UTF-8 encoding forms.
the specializations \tcode{codecvt<char32_t, char, mbstate_t>} and
\tcode{codecvt<char32_t, char8_t, mbstate_t>}
convert between the UTF-32 and UTF-8 encoding forms.

\rSec1[depr.fs.path.factory]{Deprecated filesystem path factory functions}

Expand Down
9 changes: 9 additions & 0 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3513,6 +3513,11 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
\expects
\range{gbeg}{gnext}, \range{gbeg}{gend}, and \range{gnext}{gend}
are all valid ranges.

\pnum
\ensures
\tcode{gbeg == eback()},
Expand Down Expand Up @@ -3573,6 +3578,10 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
\expects
\range{pbeg}{pend} is a valid range.

\pnum
\ensures
\tcode{pbeg == pbase()},
Expand Down
41 changes: 18 additions & 23 deletions source/locales.tex
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@
collate & \tcode{collate<char>}, \tcode{collate<wchar_t>} \\ \rowsep
ctype & \tcode{ctype<char>}, \tcode{ctype<wchar_t>} \\
& \tcode{codecvt<char, char, mbstate_t>} \\
& \tcode{codecvt<char16_t, char8_t, mbstate_t>} \\
& \tcode{codecvt<char32_t, char8_t, mbstate_t>} \\
& \tcode{codecvt<wchar_t, char, mbstate_t>} \\ \rowsep
monetary & \tcode{moneypunct<char>}, \tcode{moneypunct<wchar_t>} \\
& \tcode{moneypunct<char, true>}, \tcode{moneypunct<wchar_t, true>} \\
Expand Down Expand Up @@ -356,8 +354,6 @@
collate & \tcode{collate_byname<char>}, \tcode{collate_byname<wchar_t>} \\ \rowsep
ctype & \tcode{ctype_byname<char>}, \tcode{ctype_byname<wchar_t>} \\
& \tcode{codecvt_byname<char, char, mbstate_t>} \\
& \tcode{codecvt_byname<char16_t, char8_t, mbstate_t>} \\
& \tcode{codecvt_byname<char32_t, char8_t, mbstate_t>} \\
& \tcode{codecvt_byname<wchar_t, char, mbstate_t>} \\ \rowsep
monetary & \tcode{moneypunct_byname<char, International>} \\
& \tcode{moneypunct_byname<wchar_t, International>} \\
Expand Down Expand Up @@ -978,18 +974,18 @@
using mask = @\seebelow@;

// numeric values are for exposition only.
static const mask space = 1 << 0;
static const mask print = 1 << 1;
static const mask cntrl = 1 << 2;
static const mask upper = 1 << 3;
static const mask lower = 1 << 4;
static const mask alpha = 1 << 5;
static const mask digit = 1 << 6;
static const mask punct = 1 << 7;
static const mask xdigit = 1 << 8;
static const mask blank = 1 << 9;
static const mask alnum = alpha | digit;
static const mask graph = alnum | punct;
static constexpr mask space = 1 << 0;
static constexpr mask print = 1 << 1;
static constexpr mask cntrl = 1 << 2;
static constexpr mask upper = 1 << 3;
static constexpr mask lower = 1 << 4;
static constexpr mask alpha = 1 << 5;
static constexpr mask digit = 1 << 6;
static constexpr mask punct = 1 << 7;
static constexpr mask xdigit = 1 << 8;
static constexpr mask blank = 1 << 9;
static constexpr mask alnum = alpha | digit;
static constexpr mask graph = alnum | punct;
};
}
\end{codeblock}
Expand Down Expand Up @@ -1684,13 +1680,6 @@
convert the implementation-defined native character set.
\tcode{codecvt<char, char, mbstate_t>} implements a degenerate conversion;
it does not convert at all.
\indextext{UTF-8}%
\indextext{UTF-16}%
\indextext{UTF-32}%
The specialization \tcode{codecvt<char16_t, char8_t, mbstate_t>}
converts between the UTF-16 and UTF-8 encoding forms, and
the specialization \tcode{codecvt<char32_t, char8_t, mbstate_t>}
converts between the UTF-32 and UTF-8 encoding forms.
\tcode{codecvt<wchar_t, char, mbstate_t>}
converts between the native character sets for ordinary and wide characters.
Specializations on \tcode{mbstate_t}
Expand Down Expand Up @@ -4751,6 +4740,7 @@
The set of aliases of a known registered character encoding is an
\impldef{set of aliases of a known registered character encoding}
superset of the aliases specified in the IANA Character Sets registry.
The set of aliases for US-ASCII includes ``ASCII''.
No two aliases or primary names of distinct registered character encodings
are equivalent when compared by \tcode{text_encoding::\exposid{comp-name}}.

Expand Down Expand Up @@ -5073,6 +5063,11 @@
\tcode{ranges::range_value_t<text_encoding::aliases_view>} and
\tcode{ranges::range_reference_t<text_encoding::aliases_view>}
denote \tcode{const char*}.

\pnum
%FIXME: Is this supposed to be a remark or a requirement? Same above?
\tcode{ranges::iterator_t<text_encoding::aliases_view>}
is a constexpr iterator\iref{iterator.requirements.general}.
\end{itemdescr}

\rSec3[text.encoding.id]{Enumeration \tcode{text_encoding::id}}
Expand Down
63 changes: 41 additions & 22 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2248,25 +2248,33 @@
\end{codeblock}

\pnum
Let \exposid{container-insertable} be defined as follows:
Let \exposid{container-appendable} be defined as follows:
\begin{codeblock}
template<class Container, class Ref>
constexpr bool @\exposid{container-insertable}@ = // \expos
constexpr bool @\exposid{container-appendable}@ = // \expos
requires(Container& c, Ref&& ref) {
requires (requires { c.push_back(std::forward<Ref>(ref)); } ||
requires (requires { c.emplace_back(std::forward<Ref>(ref)); } ||
requires { c.push_back(std::forward<Ref>(ref)); } ||
requires { c.emplace(c.end(), std::forward<Ref>(ref)); } ||
requires { c.insert(c.end(), std::forward<Ref>(ref)); });
};
\end{codeblock}

\pnum
Let \exposid{container-inserter} be defined as follows:
Let \exposid{container-appendable} be defined as follows:
\begin{codeblock}
template<class Ref, class Container>
constexpr auto @\exposid{container-inserter}@(Container& c) { // \expos
if constexpr (requires { c.push_back(declval<Ref>()); })
return back_inserter(c);
else
return inserter(c, c.end());
constexpr auto @\exposid{container-appendable}@(Container& c) { // \expos
return [&c]<class Ref>(Ref&& ref) {
if constexpr (requires { c.emplace_back(declval<Ref>()); })
c.emplace_back(std::forward<Ref>(ref));
else if constexpr (requires { c.push_back(declval<Ref>()); })
c.push_back(std::forward<Ref>(ref));
else if constexpr (requires { c.emplace(c.end(), declval<Ref>()); })
c.emplace(c.end(), std::forward<Ref>(ref));
else
c.insert(c.end(), std::forward<Ref>(ref));
};
}
\end{codeblock}

Expand Down Expand Up @@ -2328,13 +2336,13 @@
\item
\tcode{\libconcept{constructible_from}<C, Args...>} is \tcode{true}, and
\item
\tcode{\exposid{container-insertable}<C, range_reference_t<R>>} is \tcode{true}:
\tcode{\exposid{container-appendable}<C, range_reference_t<R>>} is \tcode{true}:
\end{itemize}
\begin{codeblock}
C c(std::forward<Args>(args)...);
if constexpr (@\libconcept{sized_range}@<R> && @\exposid{reservable-container}@<C>)
c.reserve(static_cast<range_size_t<C>>(ranges::size(r)));
ranges::copy(r, @\exposid{container-inserter}@<range_reference_t<R>>(c));
ranges::for_each(r, @\exposid{container-append}@(c));
\end{codeblock}
\item
Otherwise, the program is ill-formed.
Expand All @@ -2344,7 +2352,7 @@
Otherwise,
if \tcode{\libconcept{input_range}<range_reference_t<R>>} is \tcode{true}:
\begin{codeblock}
to<C>(r | views::transform([](auto&& elem) {
to<C>(ref_view(r) | views::transform([](auto&& elem) {
return to<range_value_t<C>>(std::forward<decltype(elem)>(elem));
}), std::forward<Args>(args)...);
\end{codeblock}
Expand Down Expand Up @@ -2533,6 +2541,7 @@
constexpr const T* begin() const noexcept;
constexpr T* end() noexcept;
constexpr const T* end() const noexcept;
static constexpr bool empty() noexcept;
static constexpr size_t size() noexcept;
constexpr T* data() noexcept;
constexpr const T* data() const noexcept;
Expand Down Expand Up @@ -2603,6 +2612,17 @@
Equivalent to: \tcode{return data() + 1;}
\end{itemdescr}

\indexlibrarymember{empty}{single_view}%
\begin{itemdecl}
static constexpr bool empty() noexcept;
\end{itemdecl}

\begin{itemdescr}
\pnum
\effects
Equivalent to: \tcode{return false;}
\end{itemdescr}

\indexlibrarymember{size}{single_view}%
\begin{itemdecl}
static constexpr size_t size() noexcept;
Expand Down Expand Up @@ -3406,7 +3426,7 @@
Given subexpressions \tcode{E} and \tcode{F},
the expressions \tcode{views::repeat(E)} and \tcode{views::repeat(E, F)}
are expression-equivalent to
\tcode{repeat_view(E)} and \tcode{repeat_view(E, F)}, respectively.
\tcode{repeat_view<decay_t<decltype((E))>>(E)} and \tcode{repeat_view(E, F)}, respectively.

\pnum
\begin{example}
Expand Down Expand Up @@ -3456,8 +3476,8 @@
constexpr auto size() const requires (!@\libconcept{same_as}@<Bound, unreachable_sentinel_t>);
};

template<class T, class Bound>
repeat_view(T, Bound) -> repeat_view<T, Bound>;
template<class T, class Bound = unreachable_sentinel_t>
repeat_view(T, Bound = Bound()) -> repeat_view<T, Bound>;
}
\end{codeblock}

Expand Down Expand Up @@ -7909,10 +7929,9 @@
private:
@\exposid{outer-iterator}@ @\exposid{i_}@ = @\exposid{outer-iterator}@(); // \expos

public:
value_type() = default;
constexpr explicit value_type(@\exposid{outer-iterator}@ i);
constexpr explicit value_type(@\exposid{outer-iterator}@ i); // \expos

public:
constexpr @\exposid{inner-iterator}@<Const> begin() const;
constexpr default_sentinel_t end() const noexcept;
};
Expand Down Expand Up @@ -8542,7 +8561,7 @@
constexpr V base() const & requires @\libconcept{copy_constructible}@<V> { return @\exposid{base_}@; }
constexpr V base() && { return std::move(@\exposid{base_}@); }

constexpr auto begin() {
constexpr auto begin() requires (!@\exposconcept{simple-view}@<V>) {
if constexpr (@\libconcept{random_access_range}@<V> && @\libconcept{sized_range}@<V>)
return ranges::begin(@\exposid{base_}@);
else
Expand All @@ -8556,7 +8575,7 @@
return common_iterator<iterator_t<const V>, sentinel_t<const V>>(ranges::begin(@\exposid{base_}@));
}

constexpr auto end() {
constexpr auto end() requires (!@\exposconcept{simple-view}@<V>) {
if constexpr (@\libconcept{random_access_range}@<V> && @\libconcept{sized_range}@<V>)
return ranges::begin(@\exposid{base_}@) + ranges::distance(@\exposid{base_}@);
else
Expand Down Expand Up @@ -9539,13 +9558,13 @@
{ return @\exposid{iterator}@<true>(ranges::begin(@\exposid{base_}@), 0); }

constexpr auto end() requires (!@\exposconcept{simple-view}@<V>) {
if constexpr (@\libconcept{common_range}@<V> && @\libconcept{sized_range}@<V>)
if constexpr (@\libconcept{forward_range}@<V> && @\libconcept{common_range}@<V> && @\libconcept{sized_range}@<V>)
return @\exposid{iterator}@<false>(ranges::end(@\exposid{base_}@), ranges::distance(@\exposid{base_}@));
else
return @\exposid{sentinel}@<false>(ranges::end(@\exposid{base_}@));
}
constexpr auto end() const requires @\exposconcept{range-with-movable-references}@<const V> {
if constexpr (@\libconcept{common_range}@<const V> && @\libconcept{sized_range}@<const V>)
if constexpr (@\libconcept{forward_range}@<const V> && @\libconcept{common_range}@<const V> && @\libconcept{sized_range}@<const V>)
return @\exposid{iterator}@<true>(ranges::end(@\exposid{base_}@), ranges::distance(@\exposid{base_}@));
else
return @\exposid{sentinel}@<true>(ranges::end(@\exposid{base_}@));
Expand Down
Loading