That's the correct behaviour, if you ask me...
How are you creating "object"?I want the object's data to be "moved into" the set... not copied in. I have tried using QSet<Object>.insert( std::move( object ) ), but no matter what I do the copy constructor is called instead of the move constructor.
Besides, if you have explicitly shared data, I don't see any serious benefits of "moving" the data. With explicit sharing you are only copying a pointer and bumping up the reference counter (1 or 2 machine instructions).






Reply With Quote
Bookmarks