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

Method remove

dlib/sequence/sequence_kernel_2.h:322–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320 typename mem_manager
321 >
322 void sequence_kernel_2<T,mem_manager>::
323 remove (
324 unsigned long pos,
325 T& item
326 )
327 {
328 move_to_pos(current_node,current_pos,pos,sequence_size);
329 node& c_node = *current_node;
330 exchange(c_node.item,item);
331
332 node* temp = current_node;
333
334 // close up gap left by remove
335 c_node.left->right = c_node.right;
336 c_node.right->left = c_node.left;
337
338 current_node = c_node.right;
339
340 --sequence_size;
341
342 delete temp;
343 // reset the enumerator
344 reset();
345 }
346
347// ----------------------------------------------------------------------------------------
348

Callers

nothing calls this directly

Calls 2

exchangeFunction · 0.85
resetFunction · 0.85

Tested by

no test coverage detected