<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3247: ranges::iter_move should perform ADL-only lookup of iter_move</title>
<meta property="og:title" content="Issue 3247: ranges::iter_move should perform ADL-only lookup of iter_move">
<meta property="og:description" content="C++ library issue. Status: C++20">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3247.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++20">C++20</a> status.</em></p>
<h3 id="3247"><a href="lwg-defects.html#3247">3247</a>. <code>ranges::iter_move</code> should perform ADL-only lookup of <code>iter_move</code></h3>
<p><b>Section:</b> 24.3.3.1 <a href="https://wg21.link/iterator.cust.move">[iterator.cust.move]</a> <b>Status:</b> <a href="lwg-active.html#C++20">C++20</a>
 <b>Submitter:</b> Casey Carter <b>Opened:</b> 2019-07-29 <b>Last modified:</b> 2021-02-25</p>
<p><b>Priority: </b>2
</p>
<p><b>View all other</b> <a href="lwg-index.html#iterator.cust.move">issues</a> in [iterator.cust.move].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++20">C++20</a> status.</p>
<p><b>Discussion:</b></p>
<p>
The specification of the <code>ranges::iter_move</code> customization point in [iterator.cust.move] 
doesn't include a deleted poison pill overload. There is no <code>std::iter_move</code> to avoid, 
so such a poison pill is not needed. This is fine, except that it suggests that unqualified 
lookup for <code>iter_move</code> in the <code>iter_move(E)</code> expression in paragraph 1.1 should 
find declarations of iter_move in the global namespace via normal unqualified lookup, when the 
design intent is that only ADL be used to find overloads of <code>iter_move</code>.
<p/>
Absent a more idiomatic wording to specify an ADL-only lookup, we can correct the problem by 
specifying the lookup in paragraph 1.1 is performed in a context that includes the declaration 
"<code>void iter_move();</code>" which has the desired effect.
</p>

<p><i>[2020-02 Status to Immediate on Thursday morning in Prague.]</i></p>



<p id="res-3247"><b>Proposed resolution:</b></p>
<p>This wording is relative to <a href="https://wg21.link/n4820">N4820</a>.</p>

<blockquote class="note">
<p>
[<i>Drafting Note:</i> There's a drive-by fix here to change "valid" &mdash; which suggests runtime behavior 
which cannot be validated at compile time &mdash; to "well-formed".]
</p>
</blockquote>

<ol>
<li><p>Modify 24.3.3.1 <a href="https://wg21.link/iterator.cust.move">[iterator.cust.move]</a> as indicated:</p>

<blockquote>
<p>
-1- The name <code>ranges::iter_move</code> denotes a customization point object (16.3.3.3.5 <a href="https://wg21.link/customization.point.object">[customization.point.object]</a>). The expression <code>ranges::iter_move(E)</code> for 
some subexpression <code>E</code> is expression-equivalent to:
</p>
<ol style="list-style-type: none">
<li><p>(1.1) &mdash; <code>iter_move(E)</code>, if that expression is <del>valid</del><ins>well-formed 
when treated as an unevaluated operand</ins>, with overload resolution 
performed in a context that does not include a declaration of <code>ranges::iter_move</code><del>.</del> 
<ins>but does include the declaration:</ins></p>
<pre>
   <ins>void iter_move();</ins>
</pre></li>
<li><p>[&hellip;]</p></li>
</ol>
</blockquote>
</li>
</ol>




</body>
</html>
