
28 Jan
2007
28 Jan
'07
1:50 a.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