<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/119017>119017</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc++] How to handle std::flat_set::insert ambiguity between insert(iter, key) and insert(iter, iter)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            huixie90
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ldionne
      </td>
    </tr>
</table>

<pre>
    From https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2767r2.html#insert-ambiguity:

```c++
struct Address {
  const char *p_ = nullptr;
  Address(auto p) : p_((const char*)&*p) {}
  auto operator<=>(const Address&) const = default;
};
std::flat_set<Address> m, n;
m.insert(n.begin(), n.end());
 // Before: Ambiguous with insert(pos, K&&)
  // After: Unambiguously insert(first, last)
```

I'm not certain how we actually want `flat_set` to handle this, but we should have a good answer.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU09vvDYQ_TTDZRQEYxaWAweS_a1a9dxzZMALTo2N7CF0v31l2GxStZKlYcy85zf_ZAh6tEo1cHoFomnVf2tVZ0AEp0siV56cb8ygnbUq6dxwb67ezTgxLwFEC3QFum7blrpF2ZfAQ-r8CHT94D4HuoaeKAaMFL3B9QHoushF-fhBGYnoU1VWntKJZwMktA3K84ucOz2umu_xmWw_ZXacHug1nqwN7NeesR0Gr0JAqOIlYu9sYOwn6RGoXd4RxAXtaszCHsQR88AAneXKDhegGkG0uLwDnYHO3xxALVANVEauPax6heqys-xYtygv2XkQbyAuIH494c9Hyog77qKWQd3kavjQErnEkc0QkxXtzUh-D4pBvH0xiF84A72hPULn9CgT0NmmnRq13VXXe0iq7PDl1o98j07hq7o5r2Ke7V5ftwbcNE_4pFtciCR_7Jqj7D3PB7y9sfIR_aeVX3hz_wbftA8c4UZGW__s2tHE34GqGa1j7JVnqS1ObsNNoex5lcbccZOWEcrsWYQyQ3Y4STsYhTzpXV-3ckSFya1mwEl-KpQ4OjegtGFTPk2GRgy1qGWimrwS4pQX-ZmSqekHIQTdVHXOCynLIrtV_bks6krQKaupTHRDGRU5ZWVeFyKjtJCqrrJS9ue66tWpgyJTs9QmNeZzjgOf6BBW1eR5neVVYmSnTHhslNHd17geO-WbiHrp1jFAkRkdOHzzsGaz7-IP2OmCv7ntRwn-Z0yidzQBn3uDneJNKfvdHR2bR2_4l7rHcZR2-O-_w9bJ6k3z7y0fNU9rl_ZuBrpGxQ_zsnj3oXoGuu5liJv9qMRnQ_8EAAD__8QJVGM">