MCPcopy Create free account
hub / github.com/dengwirda/jigsaw / insert_next

Method insert_next

src/libcpp/containers/basic_stack.hpp:384–406  ·  view source on GitHub ↗

-------------------------- insert data (_def construct) */

Source from the content-addressed store, hash-verified

382
383/*-------------------------- insert data (_def construct) */
384 __normal_call _write_it insert_next (
385 _write_it _prev_iter
386 )
387 {
388 item_type *_prev_item, *_next_item ;
389 if ((_prev_item =
390 _prev_iter. item()) == nullptr)
391 { /*----- push onto list head */
392 return push_head() ;
393 }
394 else
395 { /* insert in middle of list */
396 item_type *_this_item =
397 self_type::allocate(1);
398 self_type::construct(
399 _this_item, _next_item);
400
401 _prev_item->next() = _this_item;
402
403 return _write_it(
404 _this_item, (self_type*)this);
405 }
406 }
407
408/*-------------------------- insert data (copy construct) */
409 __normal_call _write_it insert_next (

Callers

nothing calls this directly

Calls 3

allocateFunction · 0.85
_write_itFunction · 0.70
itemMethod · 0.45

Tested by

no test coverage detected