MCPcopy Create free account
hub / github.com/davisking/dlib / swap

Function swap

dlib/member_function_pointer/member_function_pointer_kernel_1.h:171–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 bool operator!() const { return !is_set(); }
170
171 void swap (
172 mfp_kernel_1_base_class& item
173 )
174 {
175 // make a temp copy of item
176 mfp_kernel_1_base_class temp(item);
177
178 // destory the stuff in item
179 item.destroy_mp_memory();
180 // copy *this into item
181 mp()->clone(item.mp_memory.get());
182
183 // destory the stuff in this
184 destroy_mp_memory();
185 // copy temp into *this
186 temp.mp()->clone(mp_memory.get());
187 }
188
189 protected:
190

Callers

nothing calls this directly

Calls 4

mpFunction · 0.85
destroy_mp_memoryFunction · 0.85
cloneMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected