Skip to content

Commit c9d052d

Browse files
authored
Merge 2019-11 LWG Motion 1
P1917R0 C++ Standard Library Issues to be moved in Belfast
2 parents bc68ff5 + 81f49eb commit c9d052d

File tree

9 files changed

+146
-43
lines changed

9 files changed

+146
-43
lines changed

source/algorithms.tex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9328,13 +9328,16 @@
93289328
\end{itemdecl}
93299329

93309330
\begin{itemdescr}
9331+
\pnum
9332+
Let \tcode{U} be the value type of \tcode{decltype(first)}.
9333+
93319334
\pnum
93329335
\requires
93339336
\begin{itemize}
93349337
\item
93359338
If \tcode{init} is provided,
93369339
\tcode{T} shall be \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible});
9337-
otherwise, \tcode{ForwardIterator1}'s value type
9340+
otherwise, \tcode{U}
93389341
shall be \oldconcept{MoveConstructible}.
93399342
\item
93409343
If \tcode{init} is provided, all of
@@ -9343,7 +9346,7 @@
93439346
\tcode{binary_op(*first, *first)}
93449347
shall be convertible to \tcode{T};
93459348
otherwise, \tcode{binary_op(*first, *first)}
9346-
shall be convertible to \tcode{ForwardIterator1}'s value type.
9349+
shall be convertible to \tcode{U}.
93479350
\item
93489351
\tcode{binary_op} shall neither invalidate iterators or subranges,
93499352
nor modify elements in
@@ -9491,13 +9494,16 @@
94919494
\end{itemdecl}
94929495

94939496
\begin{itemdescr}
9497+
\pnum
9498+
Let \tcode{U} be the value type of \tcode{decltype(first)}.
9499+
94949500
\pnum
94959501
\requires
94969502
\begin{itemize}
94979503
\item
94989504
If \tcode{init} is provided, \tcode{T} shall be
94999505
\oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible});
9500-
otherwise, \tcode{ForwardIterator1}'s value type shall be
9506+
otherwise, \tcode{U} shall be
95019507
\oldconcept{MoveConstructible}.
95029508
\item
95039509
If \tcode{init} is provided, all of
@@ -9508,7 +9514,7 @@
95089514
\end{itemize}
95099515
shall be convertible to \tcode{T};
95109516
otherwise, \tcode{binary_op(unary_op(*first), unary_op(*first))}
9511-
shall be convertible to \tcode{ForwardIterator1}'s value type.
9517+
shall be convertible to \tcode{U}.
95129518
\item
95139519
Neither \tcode{unary_op} nor \tcode{binary_op} shall
95149520
invalidate iterators or subranges, nor modify elements in

source/concepts.tex

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,27 @@
736736

737737
\begin{itemdecl}
738738
template<class T>
739-
concept @\deflibconcept{default_constructible}@ = constructible_from<T>;
739+
inline constexpr bool @\defexposconcept{is-default-initializable}@ = @\seebelow@; // \expos
740+
741+
template<class T>
742+
concept @\deflibconcept{default_constructible}@ = constructible_from<T> &&
743+
requires { T{}; } &&
744+
@\exposconcept{is-default-initializable}@<T>;
740745
\end{itemdecl}
741746

747+
\begin{itemdescr}
748+
\pnum
749+
For a type \tcode{T}, \tcode{\exposconcept{is-default-initializable}<T>} is \tcode{true}
750+
if and only if the variable definition
751+
\begin{codeblock}
752+
T t;
753+
\end{codeblock}
754+
is well-formed for some invented variable \tcode{t};
755+
otherwise it is \tcode{false}.
756+
Access checking is performed as if in a context unrelated to \tcode{T}.
757+
Only the validity of the immediate context of the variable initialization is considered.
758+
\end{itemdescr}
759+
742760
\rSec2[concept.moveconstructible]{Concept \cname{move_constructible}}
743761

744762
\begin{itemdecl}

source/containers.tex

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10839,6 +10839,10 @@
1083910839
\end{itemdecl}
1084010840

1084110841
\begin{itemdescr}
10842+
\pnum
10843+
\mandates
10844+
\tcode{Count <= Extent} is \tcode{true}.
10845+
1084210846
\pnum
1084310847
\expects
1084410848
\tcode{Count <= size()} is \tcode{true}.
@@ -10854,6 +10858,10 @@
1085410858
\end{itemdecl}
1085510859

1085610860
\begin{itemdescr}
10861+
\pnum
10862+
\mandates
10863+
\tcode{Count <= Extent} is \tcode{true}.
10864+
1085710865
\pnum
1085810866
\expects
1085910867
\tcode{Count <= size()} is \tcode{true}.
@@ -10870,10 +10878,17 @@
1087010878
\end{itemdecl}
1087110879

1087210880
\begin{itemdescr}
10881+
\pnum
10882+
\mandates
10883+
\begin{codeblock}
10884+
Offset <= Extent && (Count == dynamic_extent || Count <= Extent - Offset)
10885+
\end{codeblock}
10886+
is \tcode{true}.
10887+
1087310888
\pnum
1087410889
\expects
1087510890
\begin{codeblock}
10876-
Offset <= size() && (Count == dynamic_extent || Offset + Count <= size())
10891+
Offset <= size() && (Count == dynamic_extent || Count <= size() - Offset)
1087710892
\end{codeblock}
1087810893
is \tcode{true}.
1087910894

@@ -10935,7 +10950,7 @@
1093510950
\pnum
1093610951
\expects
1093710952
\begin{codeblock}
10938-
offset <= size() && (count == dynamic_extent || offset + count <= size())
10953+
offset <= size() && (count == dynamic_extent || count <= size() - offset)
1093910954
\end{codeblock}
1094010955
is \tcode{true}.
1094110956

source/iostreams.tex

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10897,7 +10897,9 @@
1089710897
using streambuf_type = basic_streambuf<charT, traits>;
1089810898

1089910899
// \ref{syncstream.syncbuf.cons}, construction and destruction
10900-
explicit basic_syncbuf(streambuf_type* obuf = nullptr)
10900+
basic_syncbuf()
10901+
: basic_syncbuf(nullptr) {}
10902+
explicit basic_syncbuf(streambuf_type* obuf)
1090110903
: basic_syncbuf(obuf, Allocator()) {}
1090210904
basic_syncbuf(streambuf_type*, const Allocator&);
1090310905
basic_syncbuf(basic_syncbuf&&);
@@ -12404,7 +12406,9 @@
1240412406

1240512407
\pnum
1240612408
Functions taking template parameters named \tcode{Source}
12407-
shall not participate in overload resolution unless either
12409+
shall not participate in overload resolution unless
12410+
\tcode{Source} denotes a type other than \tcode{path}, and
12411+
either
1240812412
\begin{itemize}
1240912413
\item
1241012414
\tcode{Source} is a specialization of
@@ -13464,10 +13468,26 @@
1346413468

1346513469
\pnum
1346613470
\effects
13467-
If \tcode{root_name() != base.root_name()} is \tcode{true}
13468-
or \tcode{is_absolute() != base.is_absolute()} is \tcode{true}
13469-
or \tcode{!has_root_directory() \&\& base.has_root_directory()} is \tcode{true},
13471+
If:
13472+
\begin{itemize}
13473+
\item
13474+
\tcode{root_name() != base.root_name()} is \tcode{true}, or
13475+
13476+
\item
13477+
\tcode{is_absolute() != base.is_absolute()} is \tcode{true}, or
13478+
13479+
\item
13480+
\tcode{!has_root_directory() \&\& base.has_root_directory()} is \tcode{true}, or
13481+
13482+
\item
13483+
any \grammarterm{filename} in
13484+
\tcode{relative_path()} or \tcode{base.relative_path()}
13485+
can be interpreted as a \grammarterm{root-name},
13486+
\end{itemize}
1347013487
returns \tcode{path()}.
13488+
\begin{note}
13489+
On a POSIX implementation, no \grammarterm{filename} in a \grammarterm{relative-path} is acceptable as a \grammarterm{root-name}.
13490+
\end{note}
1347113491
Determines the first mismatched element of \tcode{*this} and \tcode{base}
1347213492
as if by:
1347313493
\begin{codeblock}

source/iterators.tex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,7 @@
655655
\indextext{iterator!constexpr}%
656656
Iterators are called \defn{constexpr iterators}
657657
if all operations provided to meet iterator category requirements
658-
are constexpr functions, except for
659-
\begin{itemize}
660-
\item a pseudo-destructor call\iref{expr.prim.id.dtor}, and
661-
\item the construction of an iterator with a singular value.
662-
\end{itemize}
658+
are constexpr functions.
663659
\begin{note}
664660
For example, the types ``pointer to \tcode{int}'' and
665661
\tcode{reverse_iterator<int*>} are constexpr iterators.
@@ -1783,7 +1779,7 @@
17831779
\tcode{(a + D(x + y))} is equal to \tcode{((a + x) + y)}.
17841780
\item \tcode{(a + D(0))} is equal to \tcode{a}.
17851781
\item If \tcode{(a + D(n - 1))} is valid, then
1786-
\tcode{(a + n)} is equal to \tcode{++(a + D(n - 1))}.
1782+
\tcode{(a + n)} is equal to \tcode{[](I c)\{ return ++c; \}(a + D(n - 1))}.
17871783
\item \tcode{(b += -n)} is equal to \tcode{a}.
17881784
\item \tcode{(b -= n)} is equal to \tcode{a}.
17891785
\item \tcode{addressof(b -= n)} is equal to \tcode{addressof(b)}.

source/ranges.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5200,7 +5200,8 @@
52005200
namespace std::ranges {
52015201
template<class V, class Pattern>
52025202
template<bool Const>
5203-
struct split_view<V, Pattern>::outer_iterator<Const>::value_type {
5203+
struct split_view<V, Pattern>::outer_iterator<Const>::value_type
5204+
: view_interface<value_type> {
52045205
private:
52055206
outer_iterator i_ = outer_iterator(); // \expos
52065207
public:

source/support.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@
554554
// \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}
555555
#define @\defnlibxname{cpp_lib_any}@ 201606L // also in \libheader{any}
556556
#define @\defnlibxname{cpp_lib_apply}@ 201603L // also in \libheader{tuple}
557-
#define @\defnlibxname{cpp_lib_array_constexpr}@ 201603L // also in \libheader{iterator}, \libheader{array}
557+
#define @\defnlibxname{cpp_lib_array_constexpr}@ 201803L // also in \libheader{iterator}, \libheader{array}
558558
#define @\defnlibxname{cpp_lib_as_const}@ 201510L // also in \libheader{utility}
559559
#define @\defnlibxname{cpp_lib_atomic_flag_test}@ 201907L // also in \libheader{atomic}
560560
#define @\defnlibxname{cpp_lib_atomic_is_always_lock_free}@ 201603L // also in \libheader{atomic}
@@ -578,10 +578,10 @@
578578
#define @\defnlibxname{cpp_lib_concepts}@ 201806L // also in \libheader{concepts}
579579
#define @\defnlibxname{cpp_lib_constexpr}@ 201811L
580580
// also in any C++ library header from \tref{headers.cpp} or any C++ header for C library facilities from \tref{headers.cpp.c}
581+
#define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 201806L // also in \libheader{algorithm}
581582
#define @\defnlibxname{cpp_lib_constexpr_dynamic_alloc}@ 201907L // also in \libheader{memory}
582583
#define @\defnlibxname{cpp_lib_constexpr_invoke}@ 201907L // also in \libheader{functional}
583584
#define @\defnlibxname{cpp_lib_constexpr_string}@ 201907L // also in \libheader{string}
584-
#define @\defnlibxname{cpp_lib_constexpr_swap_algorithms}@ 201806L // also in \libheader{algorithm}
585585
#define @\defnlibxname{cpp_lib_constexpr_vector}@ 201907L // also in \libheader{vector}
586586
#define @\defnlibxname{cpp_lib_destroying_delete}@ 201806L // also in \libheader{new}
587587
#define @\defnlibxname{cpp_lib_enable_shared_from_this}@ 201603L // also in \libheader{memory}
@@ -650,8 +650,9 @@
650650
#define @\defnlibxname{cpp_lib_shared_timed_mutex}@ 201402L // also in \libheader{shared_mutex}
651651
#define @\defnlibxname{cpp_lib_source_location}@ 201907L // also in \libheader{source_location}
652652
#define @\defnlibxname{cpp_lib_spaceship}@ 201907L // also in \libheader{compare}
653+
#define @\defnlibxname{cpp_lib_span}@ 201902L // also in \libheader{span}
653654
#define @\defnlibxname{cpp_lib_string_udls}@ 201304L // also in \libheader{string}
654-
#define @\defnlibxname{cpp_lib_string_view}@ 201606L // also in \libheader{string}, \libheader{string_view}
655+
#define @\defnlibxname{cpp_lib_string_view}@ 201803L // also in \libheader{string}, \libheader{string_view}
655656
#define @\defnlibxname{cpp_lib_three_way_comparison}@ 201711L // also in \libheader{compare}
656657
#define @\defnlibxname{cpp_lib_to_array}@ 201907L // also in \libheader{array}
657658
#define @\defnlibxname{cpp_lib_to_chars}@ 201611L // also in \libheader{charconv}

0 commit comments

Comments
 (0)