<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115737>115737</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`<vector>`: `assign_range()` is missing __Mandates__
</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>
According to [[sequence.reqmts]](https://eel.is/c++draft/containers#sequence.reqmts-60), `a.assign_range(rg)` has the _Mandates_ of `assignable_from<T&, ranges​::​range_reference_t<R>>` s modeled, however, this is missed in the libc++ implementation.
The following should be rejected:
```cpp
#include <vector>
struct Int {
void operator=(int);
Int(int);
};
int main() {
std::vector<Int> v;
v.assign_range(std::vector{42}); // only libstdc++ rejects
}
```
https://godbolt.org/z/TrGsbcndj
Not sure if other containers have similar issues.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcU8GSozgM_RpxUTUFNpBw4JCkO1tz2D1s9Z0yWATPGjtjG1KzXz9lyHQyoVyALEt6fnoS3quLIWqgPEL5nog5jNY1I92U1v8lnZU_m0PfWyeVuWCwuJ47evoxk-kpdfRjCh7K97jYfgzh6oEfgJ2BnYl0qjywcw_sCOwonRhCNK0JQhlyHhh_SfVWZcBqYCeEKhPphq91wlwI2N5dorPKcBQew0jY_i2MFIF8i3ZYQ9YA0WlqB2cn4KdPYFXMt-bw8MFgn8H-GFHyw5e5eltHA7mIpg3AT_8C_4irytDjZCVpkjHTaG-0kIu_YVQelcdJeU8SlVlRadXdr4xqumqayAQRlDUpZO-QHbb350g4WK3tLXLrRztriR2ho-_UB5IR3tNxqLJt9dfrfYdxZXo9S0Lgp4X6YF3Euzpx-_jg5j7gNxMQdse7CxerJNorObGGxNYpEyK3_OvMt7jxug2798f_-lYm4CSUAbYHVj8X8UFuJP9Gdoop-QcuT1WW1xa_Ru2OBYtVVxC4CQut0T8jyz7I30RvrPkHzD9J28w_9XmxsrM6pDbK6vw_sPOn-8t3vZHfn2_4jw3oZ0eoBrRhJIcPAeMoFkKvJqWFQ-X9TD5NZMNlzWuRUJPveM4LlvMiGZuq4mXe7QdRUj9kdV7WNXGSVS0KWYo6T1TDMlbk8akYy4t0J3ld7jmv8kJkBS-gyGgSSqdaL1MEnqw1mzwvd3yXaNGR9uswM2botiECxuJsuyYGvXXzxUORaeWDf6QJKmhqIlHPSorm4TFWX026T-Fd-FG-7WMS22R2unmhWoVx7tLeTsDOsej983Z1NvYN2HkjD9j5fpelYb8CAAD__583ZHY">