[Bug libstdc++/98473] std::vector::insert(pos, first, last) doesn't compile for T which has a deleted assignment operator

2021-01-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98473 --- Comment #4 from Jonathan Wakely --- (In reply to Borislav Stanimirov from comment #2) > (In reply to Jonathan Wakely from comment #1) > > > To meet the requirements of the standard we would need to insert them at the > > end and then use

[Bug libstdc++/98473] std::vector::insert(pos, first, last) doesn't compile for T which has a deleted assignment operator

2021-01-04 Thread b.stanimirov at abv dot bg via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98473 --- Comment #3 from Borislav Stanimirov --- By the way, this is not just some esoteric synthetic example. A type which is copy-constructible but not copy-assignable is very useful to model immutable objects.

[Bug libstdc++/98473] std::vector::insert(pos, first, last) doesn't compile for T which has a deleted assignment operator

2021-01-01 Thread b.stanimirov at abv dot bg via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98473 --- Comment #2 from Borislav Stanimirov --- (In reply to Jonathan Wakely from comment #1) > To meet the requirements of the standard we would need to insert them at the > end and then use std::rotate to reposition them. Or, to save move

[Bug libstdc++/98473] std::vector::insert(pos, first, last) doesn't compile for T which has a deleted assignment operator

2020-12-31 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98473 --- Comment #1 from Jonathan Wakely --- Complete example: #include struct X { X(); X(const X&); X& operator=(const X&) = delete; // !! X(X&&) noexcept; X& operator=(X&&) noexcept; int data = 54; }; void