File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-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 =" 4452" status =" New" >
5+ <title >Make <i >deref-move</i > constexpr</title >
6+ <section ><sref ref =" [specialized.algorithms.general]" /></section >
7+ <submitter >S.B. Tam</submitter >
8+ <date >05 Nov 2025</date >
9+ <priority >99</priority >
10+
11+ <discussion >
12+ <p >
13+ `std::uninitialized_move` and `std::uninitialized_move_n` are constexpr and invoke <i >`deref-move`</i >,
14+ but <i >`deref-move`</i > is not constexpr. This looks like an obvious mistake.
15+ </p >
16+
17+ <p >
18+ Jiang An pointed out that <paper num =" P3508R0" /> and LWG <iref ref =" 3918" />,
19+ both touching `std::uninitialized_move(_n)`, were adopted at the same meeting,
20+ and unfortunately none of them was aware of the other.
21+ </p >
22+ </discussion >
23+
24+ <resolution >
25+ <p >
26+ This wording is relative to <paper num =" N5014" />.
27+ </p >
28+
29+ <ol >
30+ <li ><p >Modify <sref ref =" [specialized.algorithms.general]" />, as indicated:</p >
31+
32+ <blockquote >
33+ <pre >
34+ template< class I>
35+ decltype(auto) <i >deref-move</i >(I& it) {
36+ constexpr decltype(auto) <i >deref-move</i >(I& it) {
37+ if constexpr (is_lvalue_reference_v< decltype(*it)> )
38+ return std::move(*it);
39+ else
40+ return *it;
41+ }
42+ </pre >
43+ </blockquote >
44+ </li >
45+ </ol >
46+
47+ </resolution >
48+
49+ </issue >
You can’t perform that action at this time.
0 commit comments