File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-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 =" 4115" status =" New" >
5
+ <title ><tt >move_iterator::operator*</tt > should have conditional <tt >noexcept</tt > specification</title >
6
+ <section ><sref ref =" [move.iter.elem]" /></section >
7
+ <submitter >Hewill Kang</submitter >
8
+ <date >03 Jul 2024</date >
9
+ <priority >99</priority >
10
+
11
+ <discussion >
12
+ <p >
13
+ For <tt >move_iterator</tt >, dereferencing it is actually equivalent to applying <tt >iter_move</tt > to it.
14
+ <p />
15
+ However, unlike the latter, <tt >move_iterator</tt >'s dereference operator lacks a <tt >noexcept</tt >
16
+ specification, which seems to be an oversight given that the standard goes to such great lengths to
17
+ preserve the noexceptness of <tt >iter_move</tt >, and the main purpose of <tt >move_iterator</tt > is
18
+ precisely to apply <tt >iter_move</tt > to the underlying iterator via dereferencing.
19
+ </p >
20
+ </discussion >
21
+
22
+ <resolution >
23
+ <p >
24
+ This wording is relative to <paper num =" N4981" />.
25
+ </p >
26
+
27
+ <ol >
28
+ <li ><p >Modify <sref ref =" [move.iterator]" /> as indicated:</p >
29
+
30
+ <blockquote ><pre >
31
+ namespace std {
32
+ template< class Iterator>
33
+ class move_iterator {
34
+ public:
35
+ [… ]
36
+ constexpr reference operator*() const <ins >noexcept(noexcept(ranges::iter_move(current)))</ins >;
37
+ [… ]
38
+ };
39
+ }
40
+ </pre ></blockquote >
41
+
42
+ </li >
43
+
44
+ <li ><p >Modify <sref ref =" [move.iter.elem]" /> as indicated:</p >
45
+
46
+ <blockquote >
47
+ <pre >
48
+ constexpr reference operator*() const <ins >noexcept(noexcept(ranges::iter_move(current)))</ins >;
49
+ </pre >
50
+ <blockquote >
51
+ <p >
52
+ -1- <i >Effects</i >: Equivalent to: <tt >return ranges::iter_move(current);</tt >
53
+ </p >
54
+ </blockquote >
55
+ </blockquote >
56
+
57
+ </li >
58
+ </ol >
59
+ </resolution >
60
+
61
+ </issue >
You can’t perform that action at this time.
0 commit comments