Many STL algorithms use swap instead of copy constructors
| 1253 | |
| 1254 | // Many STL algorithms use swap instead of copy constructors |
| 1255 | void swap(sparsegroup& x) |
| 1256 | { |
| 1257 | using std::swap; |
| 1258 | |
| 1259 | swap(_group, x._group); |
| 1260 | swap(_bitmap, x._bitmap); |
| 1261 | swap(_bm_erased, x._bm_erased); |
| 1262 | #ifdef SPP_STORE_NUM_ITEMS |
| 1263 | swap(_num_buckets, x._num_buckets); |
| 1264 | swap(_num_allocated, x._num_allocated); |
| 1265 | #endif |
| 1266 | } |
| 1267 | |
| 1268 | // It's always nice to be able to clear a table without deallocating it |
| 1269 | void clear(allocator_type &alloc, bool erased) |