| Issue |
115737
|
| Summary |
`<vector>`: `assign_range()` is missing __Mandates__
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
hewillk
|
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs