<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134347>134347</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`<flat_set>`: `flat_set::emplace()` is underconstrained
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hewillk
</td>
</tr>
</table>
<pre>
[[flat.set.modifiers]](https://eel.is/c++draft/flat.set.modifiers#1):
> ```cpp
> template<class K> constexpr pair<iterator, bool> insert(K&& x);
> template<class K> constexpr iterator insert(const_iterator hint, K&& x);
> ```
> Constraints: The _qualified-id_ `Compare::is_transparent` is valid and denotes a type. `is_constructible_v<value_type, K>` is `true`.
This means that the following code is well-formed since we will not enter the `emplace` branch:
```cpp
#include <flat_set>
#include <ranges>
#include <vector>
int main() {
std::vector<int> v;
auto m = std::ranges::to<std::flat_set<int>>(v, v);
}
```
https://godbolt.org/z/6hj55Mqdr
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVE2P4ygQ_TWVC2qLBn8efEjcnctob3OPiCnHzGLwQNmZ2V-_wkk6O60-rISUuD5eFe8VpWI0F4fYQnGA4m2nFhp9aEe8Gmv_3p29_n1zHQarKItI2eS1GQyGCMVbOqIeieYIcg_iCOKIaDMTQRx7EAcQBx3UQCCOXwAI-QqiSZl8O_KdQclvp5_nu4lwmq0iBNn1VsXIviVr710k_DUHNisTQHaGMCjyAUTHzt7bFGRcxEAg6m8gShAl-7XVO_xP5AfkE2fznT7so3GU6n0N_3GX-3eXkoMyjhJb7PuI7PRzUTaxoV-MPqWMzk-zCgjvAmoO9SGxI_cfnyaeKCgXU4wjKDkzka3KGs2U00yj84SRKUa_Z8wSoImnreuw9GTOFk8ryG5VdsFTirm1L9_vUFByCgtCybObKN9HE9mEykVGoyJGI7LBW-uvxl1Y7zWmtCta-zL4MKFm0bge2RVZmiHmPDF0hGHLhJJvnPepAjsH5frxqf8n7YU0rreLRgayS-Nzikip1c--oNwF41eeFfs0EjcP3xtHbFLGgahBNAyqJBVjkfSN5kd4l3SV72y9icmYWsiziYF8ewY_qqb_5EF2H55nr3egdES9Jq7X54hUb_-9NPD9nw_p4vXZW8p8uIA4_gPiWI4_iuKvnzoA3-90K3UjG7XD9rXKZZUXDZe7se0bLsqhVj1WnA9qEJKXTaMLXhd5pZDvTCu4KHjOc14Ur7nMmkYPeYWqeq0rLioFOcdJGZtZu06p_M7EuGD7KnOZVzurzmjjthaEcHhlmxeESAsktCnp5bxcIuTcmkjxCUOGLLbprn_qmQz7NBtPY6LxMSmbWPf5XJzG0D8eEurdEmz7iTdD43LOej-BOKba95-XOfgf2KddtHWcdtT9Smsr_g0AAP__1ieJYg">