Re: [boost] Variant/Any and the never-empty guarantee

27 Jan
2007
27 Jan
'07
6:50 p.m.
AMDG Mathias Gaunard wrote:
I see the problem now. If you move the object, then the pointer in the set doesn't point to a valid object anymore.
Would a move constructor that replaces the pointer in the set completely solve the problem?
Unfortunately, such a move constructor could throw. So we would be left right back where we started. Making a nothrow move constructor would require reimplementing std::set to allow elements to be modified in a way that changes their ordering without calling erase/insert. In Christ, Steven Watanabe
6795
Age (days ago)
6795
Last active (days ago)
0 comments
1 participants
participants (1)
-
Steven Watanabe