Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a41e33c
LWG3088 forward_list::merge behavior unclear when passed *this
jensmaurer Feb 10, 2022
26afca8
LWG3471 polymorphic_allocator::allocate does not satisfy Cpp17Allocat…
jensmaurer Feb 10, 2022
24a304f
LWG3525 uses_allocator_construction_args fails to handle types conver…
jensmaurer Feb 10, 2022
23b74d7
LWG3598 system_category().default_error_condition(0) is underspecified
jensmaurer Feb 10, 2022
9c4644f
LWG3601 common_iterator's postfix-proxy needs indirectly_readable
jensmaurer Feb 10, 2022
23f68f8
LWG3607 contiguous_iterator should not be allowed to have custom iter…
jensmaurer Feb 10, 2022
bf3fad5
LWG3610 iota_view::size sometimes rejects integer-class types
jensmaurer Feb 10, 2022
5a8a894
LWG3612 Inconsistent pointer alignment in std::format
jensmaurer Feb 10, 2022
d82020d
LWG3618 Unnecessary iter_move for transform_view::iterator
jensmaurer Feb 10, 2022
095b2c2
LWG3619 Specification of vformat_to contains ill-formed formatted_siz…
jensmaurer Feb 10, 2022
d45eb35
LWG3621 Remove feature-test macro __cpp_lib_monadic_optional
jensmaurer Feb 10, 2022
04a75f4
LWG3632 unique_ptr "Mandates: This constructor is not selected by cla…
jensmaurer Feb 10, 2022
66c7580
LWG3643 Missing constexpr in std::counted_iterator
jensmaurer Feb 10, 2022
49131ae
LWG3648 format should not print bool with 'c'
jensmaurer Feb 10, 2022
972e578
LWG3650 Are std::basic_string's iterator and const_iterator constexpr…
jensmaurer Feb 10, 2022
2e371d9
LWG3654 basic_format_context::arg(size_t) should be noexcept
jensmaurer Feb 10, 2022
351afbf
LWG3657 std::hash<std::filesystem::path> is not enabled
jensmaurer Feb 10, 2022
148fab5
LWG3660 iterator_traits<common_iterator>::pointer should conform to […
jensmaurer Feb 10, 2022
3452bc7
LWG3661 constinit atomic<shared_ptr<T>> a(nullptr); should work
jensmaurer Feb 10, 2022
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
1 change: 1 addition & 0 deletions source/atomics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2801,6 +2801,7 @@
bool is_lock_free() const noexcept;

constexpr atomic() noexcept;
constexpr atomic(nullptr_t) noexcept : atomic() { }
atomic(shared_ptr<T> desired) noexcept;
atomic(const atomic&) = delete;
void operator=(const atomic&) = delete;
Expand Down
55 changes: 31 additions & 24 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7156,18 +7156,22 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
Let \tcode{comp} be \tcode{less<>{}} for the first two overloads.

\pnum
\expects
\tcode{*this} and \tcode{x} are both sorted with respect to
the comparator \tcode{operator<} (for the first two overloads) or
\tcode{comp} (for the last two overloads), and
\tcode{*this} and \tcode{x} are both sorted
with respect to the comparator \tcode{comp}, and
\tcode{get_allocator() == x.get_allocator()} is \tcode{true}.

\pnum
\effects
Merges the two sorted ranges \tcode{[begin(), end())} and
\tcode{[x.begin(), x.end())}. \tcode{x} is empty after the merge. If an
exception is thrown other than by a comparison there are no effects.
If \tcode{addressof(x) == this}, there are no effects.
Otherwise, merges
the two sorted ranges \range{begin()}{end()} and \range{x.begin()}{x.end()}.
The result is a range
that is sorted with respect to the comparator \tcode{comp}.
Pointers and references to the moved elements of \tcode{x} now refer to those same elements
but as members of \tcode{*this}. Iterators referring to the moved elements will continue to
refer to their elements, but they now behave as iterators into \tcode{*this}, not into
Expand All @@ -7176,11 +7180,15 @@
\pnum
\complexity
At most \tcode{distance(begin(),
end()) + distance(x.begin(), x.end()) - 1} comparisons.
end()) + distance(x.begin(), x.end()) - 1} comparisons
if \tcode{addressof(x) != this}; otherwise, no comparisons are performed.

\pnum
\remarks
Stable\iref{algorithm.stable}.
If \tcode{addressof(x) != this}, \tcode{x} is empty after the merge.
No elements are copied by this operation.
If an exception is thrown other than by a comparison, there are no effects.
\end{itemdescr}

\indexlibrarymember{sort}{forward_list}%
Expand Down Expand Up @@ -7857,40 +7865,39 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
Let \tcode{comp} be \tcode{less<>{}} for the first two overloads.

\pnum
\expects
Both the list and the argument list
shall be sorted with respect to
the comparator \tcode{operator<} (for the first two overloads) or
\tcode{comp} (for the last two overloads), and
\tcode{*this} and \tcode{x} are both sorted
with respect to the comparator \tcode{comp}, and
\tcode{get_allocator() == x.get_allocator()} is \tcode{true}.

\pnum
\effects
If \tcode{addressof(x) == this}, does nothing; otherwise, merges the two sorted ranges \tcode{[begin(),
end())} and \tcode{[x.\brk{}begin(), x.end())}. The result is a range in which the elements
will be sorted in non-decreasing order according to the ordering defined by \tcode{comp}; that
is, for every iterator \tcode{i}, in the range other than the first, the condition
\tcode{comp(*i, *(i - 1))} will be \tcode{false}.
If \tcode{addressof(x) == this}, there are no effects.
Otherwise, merges
the two sorted ranges \range{begin()}{end()} and \range{x.begin()}{x.end()}.
The result is a range
that is sorted with respect to the comparator \tcode{comp}.
Pointers and references to the moved elements of \tcode{x} now refer to those same elements
but as members of \tcode{*this}. Iterators referring to the moved elements will continue to
refer to their elements, but they now behave as iterators into \tcode{*this}, not into
\tcode{x}.

\pnum
\complexity
At most
\tcode{size() + x.size() - 1}
applications of \tcode{comp} if
\tcode{addressof(x) != this};
otherwise, no applications of \tcode{comp} are performed.
If an exception is thrown other than by a comparison there are no effects.
At most \tcode{size() + x.size() - 1} comparisons
if \tcode{addressof(x) != this};
otherwise, no comparisons are performed.

\pnum
\remarks
Stable\iref{algorithm.stable}. If \tcode{addressof(x) != this}, the range \tcode{[x.begin(), x.end())}
is empty after the merge.
Stable\iref{algorithm.stable}.
If \tcode{addressof(x) != this}, \tcode{x} is empty after the merge.
No elements are copied by this operation.
If an exception is thrown other than by a comparison there are no effects.
\end{itemdescr}

\indexlibrarymember{reverse}{list}%
Expand Down
12 changes: 7 additions & 5 deletions source/diagnostics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,13 @@
pointer to the string \tcode{"system"}. The object's \tcode{default_error_condition}
virtual function shall behave as follows:

If the argument \tcode{ev} corresponds to a POSIX \tcode{errno} value \tcode{posv}, the
function shall return \tcode{error_condition(posv, generic_category())}.
Otherwise, the function shall return \tcode{error_condition(ev,
system_category())}. What constitutes correspondence for any given operating
system is unspecified.
If the argument \tcode{ev} is equal to 0,
the function returns \tcode{error_condition(0, generic_category())}.
Otherwise,
if \tcode{ev} corresponds to a POSIX \tcode{errno} value \tcode{pxv},
the function returns \tcode{error_condition(pxv, generic_category())}.
Otherwise, the function returns \tcode{error_condition(ev, system_category())}.
What constitutes correspondence for any given operating system is unspecified.
\begin{note}
The number of potential system error codes is large
and unbounded, and some might not correspond to any POSIX \tcode{errno} value. Thus
Expand Down
19 changes: 19 additions & 0 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12668,6 +12668,12 @@
path weakly_canonical(const path& p, error_code& ec);
}

// \ref{fs.path.hash}, hash support
namespace std {
template<class T> struct hash;
template<> struct hash<filesystem::path>;
}

namespace std::ranges {
template<>
inline constexpr bool enable_borrowed_range<filesystem::directory_iterator> = true;
Expand Down Expand Up @@ -14618,6 +14624,19 @@
Equivalent to: \tcode{return path(lhs) /= rhs;}
\end{itemdescr}

\rSec3[fs.path.hash]{Hash support}

\begin{itemdecl}
template<> struct hash<filesystem::path>;
\end{itemdecl}

\begin{itemdescr}
\pnum
For an object \tcode{p} of type \tcode{filesystem::path},
\tcode{hash<filesystem::path>()(p)} evaluates to the same result as
\tcode{filesystem::hash_value(p)}.
\end{itemdescr}

\rSec2[fs.class.filesystem.error]{Class \tcode{filesystem_error}}

\rSec3[fs.class.filesystem.error.general]{General}
Expand Down
28 changes: 18 additions & 10 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1911,8 +1911,12 @@
The type \tcode{I} models \libconcept{contiguous_iterator} only if
\begin{itemize}
\item \tcode{to_address(a) == addressof(*a)},
\item \tcode{to_address(b) == to_address(a) + D(b - a)}, and
\item \tcode{to_address(c) == to_address(a) + D(c - a)}.
\item \tcode{to_address(b) == to_address(a) + D(b - a)},
\item \tcode{to_address(c) == to_address(a) + D(c - a)},
\item \tcode{ranges::iter_move(a)} has
the same type, value category, and effects as \tcode{std::move(*a)}, and
\item if \tcode{ranges::iter_swap(a, b)} is well-formed,
it has effects equivalent to \tcode{ranges::swap(*a, *b)}.
\end{itemize}

\rSec2[iterator.cpp17]{\Cpp{}17 iterator requirements}
Expand Down Expand Up @@ -2088,6 +2092,9 @@
The implementation of an algorithm on input iterators
should never attempt to pass through the same iterator twice;
such an algorithm should be a single pass algorithm.

\newpage

\begin{note}
For input iterators, \tcode{a == b} does not imply \tcode{++a == ++b}.
(Equality does not guarantee the substitution property or referential transparency.)
Expand All @@ -2107,8 +2114,6 @@
and the expressions in \tref{outputiterator}
are valid and have the indicated semantics.

\newpage

\begin{libreqtab4b}[floattable]
{\defnoldconcept{OutputIterator} requirements (in addition to \oldconcept{Iterator})}
{outputiterator}
Expand Down Expand Up @@ -4867,9 +4872,9 @@
otherwise it denotes \tcode{input_iterator_tag}.

\item
Let \tcode{a} denote an lvalue of type \tcode{const common_iterator<I, S>}.
If the expression \tcode{a.operator->()} is well-formed,
where \tcode{a} is an lvalue of type \tcode{const common_iterator<I, S>},
then \tcode{pointer} denotes the type of that expression.
then \tcode{pointer} denotes \tcode{decltype(a.operator->())}.
Otherwise, \tcode{pointer} denotes \keyword{void}.
\end{itemize}

Expand Down Expand Up @@ -5060,8 +5065,11 @@
Otherwise, if
\tcode{requires(I\& i) \{ \{ *i++ \} -> \exposconceptnc{can-reference}; \}}
is \tcode{true} or
\tcode{\libconceptx{constructible_\newline{}from}{constructible_from}<iter_value_t<I>, iter_reference_t<I>> \&\& \libconcept{move_constructible}<iter_value_t<I>>}
is \linebreak \tcode{false},
\begin{codeblock}
@\libconcept{indirectly_readable}@<I> && @\libconcept{constructible_from}@<iter_value_t<I>, iter_reference_t<I>> &&
@\libconcept{move_constructible}@<iter_value_t<I>>
\end{codeblock}
is \tcode{false},
equivalent to:
\begin{codeblock}
return get<I>(v_)++;
Expand Down Expand Up @@ -5273,7 +5281,7 @@
requires @\libconcept{contiguous_iterator}@<I>;

constexpr counted_iterator& operator++();
decltype(auto) operator++(int);
constexpr decltype(auto) operator++(int);
constexpr counted_iterator operator++(int)
requires @\libconcept{forward_iterator}@<I>;
constexpr counted_iterator& operator--()
Expand Down Expand Up @@ -5491,7 +5499,7 @@

\indexlibrarymember{operator++}{counted_iterator}%
\begin{itemdecl}
decltype(auto) operator++(int);
constexpr decltype(auto) operator++(int);
\end{itemdecl}

\begin{itemdescr}
Expand Down
13 changes: 3 additions & 10 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,7 @@
\remarks
The expression in the \grammarterm{requires-clause} is equivalent to:
\begin{codeblock}
(@\libconcept{same_as}@<W, Bound> && @\exposconcept{advanceable}@<W>) || (@\libconcept{integral}@<W> && @\libconcept{integral}@<Bound>) ||
(@\libconcept{same_as}@<W, Bound> && @\exposconcept{advanceable}@<W>) || (@\exposid{is-integer-like}@<W> && @\exposid{is-integer-like}@<Bound>) ||
@\libconcept{sized_sentinel_for}@<Bound, W>
\end{codeblock}
\end{itemdescr}
Expand Down Expand Up @@ -4125,7 +4125,8 @@
constexpr const iterator_t<@\exposid{Base}@>& base() const & noexcept;
constexpr iterator_t<@\exposid{Base}@> base() &&;

constexpr decltype(auto) operator*() const {
constexpr decltype(auto) operator*() const
noexcept(noexcept(invoke(*@\exposid{parent_}@->@\exposid{fun_}@, *@\exposid{current_}@))) {
return invoke(*@\exposid{parent_}@->@\exposid{fun_}@, *@\exposid{current_}@);
}

Expand Down Expand Up @@ -4169,14 +4170,6 @@
requires @\libconcept{random_access_range}@<@\exposid{Base}@>;
friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y)
requires @\libconcept{sized_sentinel_for}@<iterator_t<@\exposid{Base}@>, iterator_t<@\exposid{Base}@>>;

friend constexpr decltype(auto) iter_move(const @\exposid{iterator}@& i)
noexcept(noexcept(invoke(*i.@\exposid{parent_}@->@\exposid{fun_}@, *i.@\exposid{current_}@))) {
if constexpr (is_lvalue_reference_v<decltype(*i)>)
return std::move(*i);
else
return *i;
}
};
}
\end{codeblock}
Expand Down
4 changes: 4 additions & 0 deletions source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,10 @@
refers to the \tcode{size_type} member type of
the type deduced by the deduction guide.

\pnum
The types \tcode{iterator} and \tcode{const_iterator} meet
the constexpr iterator requirements\iref{iterator.requirements.general}.

\rSec3[string.require]{General requirements}

\pnum
Expand Down
3 changes: 1 addition & 2 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,6 @@
#define @\defnlibxname{cpp_lib_math_constants}@ 201907L // also in \libheader{numbers}
#define @\defnlibxname{cpp_lib_math_special_functions}@ 201603L // also in \libheader{cmath}
#define @\defnlibxname{cpp_lib_memory_resource}@ 201603L // also in \libheader{memory_resource}
#define @\defnlibxname{cpp_lib_monadic_optional}@ 202110L // also in \libheader{optional}
#define @\defnlibxname{cpp_lib_move_only_function}@ 202110L // also in \libheader{functional}
#define @\defnlibxname{cpp_lib_node_extract}@ 201606L
// also in \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}
Expand All @@ -659,7 +658,7 @@
// \libheader{unordered_map}, \libheader{unordered_set}, \libheader{vector}
#define @\defnlibxname{cpp_lib_not_fn}@ 201603L // also in \libheader{functional}
#define @\defnlibxname{cpp_lib_null_iterators}@ 201304L // also in \libheader{iterator}
#define @\defnlibxname{cpp_lib_optional}@ 202106L // also in \libheader{optional}
#define @\defnlibxname{cpp_lib_optional}@ 202110L // also in \libheader{optional}
#define @\defnlibxname{cpp_lib_out_ptr}@ 202106L // also in \libheader{memory}
#define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric}
#define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource}
Expand Down
Loading