John Harrison said:
No they don't. Use a smart pointer.
Agreed.
A sometimes valid alternative is to use the swap() member
function of std::set (or any other container):
set1.swap( set2 );
This is guaranteed to be efficiently implemented, and might allow
you to do what you want.
For example, a common C++ idiom to avoid unnecessary copies
when adding items to a container is to replace:
myQueueOfSets.push_back( aNewSet )
with:
myQueueOfSets.push_back( std::set<ItemType>() ); // add empty set
myQueueOfSets.back().swap( aNewSet );
hth-Ivan