File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =' 1.0' encoding =' utf-8' standalone =' no' ?>
2
+ <!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3
+
4
+ <issue num =" 4025" status =" New" >
5
+ <title >Move assignment operator of <tt >std::expected< <i >cv</i > void, E> </tt > should not be conditionally deleted</title >
6
+ <section ><sref ref =" [expected.void.assign]" /></section >
7
+ <submitter >Jiang An</submitter >
8
+ <date >16 Dec 2023</date >
9
+ <priority >99</priority >
10
+
11
+ <discussion >
12
+ <p >
13
+ It seems intended that copy functions of <tt >std::optional</tt >, <tt >std::variant</tt >, and <tt >std::expected</tt >
14
+ are conditionally deleted, while move functions are constrained. However, the move assignment operator of
15
+ <tt >std::expected< <i >cv</i > void, E> </tt > is currently conditionally deleted, which is inconsistent.
16
+ </p >
17
+ </discussion >
18
+
19
+ <resolution >
20
+ <p >
21
+ This wording is relative to <paper num =" N4971" />.
22
+ </p >
23
+
24
+ <ol >
25
+
26
+ <li ><p >Modify <sref ref =" [expected.void.assign]" /> as indicated:</p >
27
+
28
+ <blockquote >
29
+ <pre >
30
+ constexpr expected& operator=(expected&& rhs) noexcept(<i >see below</i >);
31
+ </pre >
32
+ <blockquote >
33
+ <p >
34
+ <ins >-?- <i >Constraints</i >: <tt >is_move_constructible_v< E> </tt > is <tt >true</tt > and
35
+ <tt >is_move_assignable_v< E> </tt > is <tt >true</tt >.</ins >
36
+ <p />
37
+ [… ]
38
+ <p />
39
+ -6- <i >Remarks</i >: The exception specification is equivalent to <tt >is_nothrow_move_constructible_v< E> &&
40
+ is_nothrow_move_assignable_v< E> </tt >.
41
+ <p />
42
+ <del >-7- This operator is defined as deleted unless <tt >is_move_constructible_v< E> </tt > is <tt >true</tt >
43
+ and <tt >is_move_assignable_v< E> </tt > is <tt >true</tt >.</del >
44
+ </p >
45
+ </blockquote >
46
+ </blockquote >
47
+ </li >
48
+
49
+ </ol >
50
+
51
+
52
+ </resolution >
53
+
54
+ </issue >
You can’t perform that action at this time.
0 commit comments