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

Method dec_count

src/libcpp/containers/array.hpp:477–496  ·  view source on GitHub ↗

--------------------------------------- decrement count */

Source from the content-addressed store, hash-verified

475
476/*--------------------------------------- decrement count */
477 __normal_call void_type dec_count (
478 size_type _dec_count ,
479 __cont::alloc_types _new_alloc =
480 __cont::loose_alloc
481 )
482 {
483 /*---- update buffer pointers and _destruct old items */
484 size_type _cur_count = count() ;
485 _write_it _head = tend() - _dec_count;
486 dtor_iter(_head , tend());
487 this->_ptrs[_tptr] -= _dec_count;
488 /*---- shrink underlying buffer, based on size policy */
489 switch (_new_alloc )
490 {
491 case __cont::loose_alloc :
492 { /* do nothing - preserve buffer */ break; }
493 case __cont::tight_alloc :
494 { set_alloc(_cur_count - _dec_count); break; }
495 }
496 }
497
498/*---------------------------- set count (_def construct) */
499 __inline_call void_type set_count (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected