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

Standardizing Variant: Difficult Decisions

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

56 comments sorted by

View all comments

Show parent comment

1

u/TiagoRabello Jun 18 '15 edited Jun 18 '15

AFAIK, some node-based containers require allocation of sentinel nodes even for the empty state and as such may throw while making the moved from variable destructible. Maybe /u/STL can give us more insight into the problem.

2

u/STL MSVC STL Dev Jun 19 '15

Between them, /u/sakarri and /u/Plorkyeran have explained it. Move assignment doesn't have to allocate, ignoring POCMA.

1

u/TiagoRabello Jun 20 '15

Yeah, that was what I thought. Thanks for the reply!