MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / swap

Method swap

libCacheSim/dataStructure/sparsepp/spp.h:2038–2050  ·  view source on GitHub ↗

Many STL algorithms use swap instead of copy constructors

Source from the content-addressed store, hash-verified

2036
2037 // Many STL algorithms use swap instead of copy constructors
2038 void swap(sparsetable& o)
2039 {
2040 using std::swap;
2041
2042 swap(_first_group, o._first_group);
2043 swap(_last_group, o._last_group);
2044 swap(_table_size, o._table_size);
2045 swap(_num_buckets, o._num_buckets);
2046 if (_alloc != o._alloc)
2047 swap(_alloc, o._alloc);
2048 if (_group_alloc != o._group_alloc)
2049 swap(_group_alloc, o._group_alloc);
2050 }
2051
2052 // It's always nice to be able to clear a table without deallocating it
2053 void clear()

Callers 2

sparsetableMethod · 0.95
sparsetableClass · 0.95

Calls 1

swapFunction · 0.70

Tested by

no test coverage detected