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

Method resize

dlib/array/array_kernel.h:646–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644 typename mem_manager
645 >
646 void array<T,mem_manager>::
647 resize (
648 size_t new_size
649 )
650 {
651 if (this->max_size() < new_size)
652 {
653 array temp;
654 temp.set_max_size(new_size);
655 temp.set_size(new_size);
656 for (size_t i = 0; i < this->size(); ++i)
657 {
658 exchange((*this)[i],temp[i]);
659 }
660 temp.swap(*this);
661 }
662 else
663 {
664 this->set_size(new_size);
665 }
666 }
667
668// ----------------------------------------------------------------------------------------
669

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.95
exchangeFunction · 0.85
set_max_sizeMethod · 0.80
max_sizeMethod · 0.45
set_sizeMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected