r/cpp • wx | soci | swig • Jun 17 '15

Standardizing Variant: Difficult Decisions

https://www.justsoftwaresolutions.co.uk/cplusplus/standardizing-variant.html
31 Upvotes

56 comments sorted by

View all comments

Show parent comment

4

u/Plorkyeran Jun 18 '15

For move assignment, A = std::move(B)... to preserve iterators you would need to move B's sentinel over to A and B would need to allocate a new sentinel to represent its new end.

Why can't you just swap the sentinels?