Quuxplusone added a comment.

>> Are you not allowed to move the containers elements in this case?
> 
> Correct. The allocator is not POCMA and not equal, so it's functionally the 
> same as doing `assign(make_move_iterator(begin()), 
> make_move_iterator(end()))`.

In case the clarification helps some reader: When the allocator is 
not-POCMA-and-not-equal, then you are forbidden to //pilfer// the //pointer// 
from the source container, but you are indeed allowed to //move// the 
//elements//, and that's what Billy is describing. You could finish by having 
the source container destroy all its elements (those elements being now in a 
moved-from state) and become empty, but that's less efficient than keeping the 
moved-from elements around.

Unless of course you know that the element type is //trivially relocatable//... 
;)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61366/new/

https://reviews.llvm.org/D61366



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D61366: [l... Billy Robert O'Neal III via Phabricator via cfe-commits
    • [PATCH] D6136... Billy Robert O'Neal III via Phabricator via cfe-commits
    • [PATCH] D6136... Eric Fiselier via Phabricator via cfe-commits
    • [PATCH] D6136... Billy Robert O'Neal III via Phabricator via cfe-commits
    • [PATCH] D6136... Arthur O'Dwyer via Phabricator via cfe-commits
    • [PATCH] D6136... Billy Robert O'Neal III via Phabricator via cfe-commits

Reply via email to