c++11 - Call delete on std::vector -



c++11 - Call delete on std::vector -

do have phone call delete on destructor of class uses std::vectors ? if not, why?

for example:

test.h:

class test { private: // signal buffer raw signal , moving average std::vector<double> buffer; // sensor signal buffer ... }

test.cpp:

#include "test.h" test::~test() { // no delete std:vector utilize std memory allocation ??? } test::test() { buffer.reserve(100); // going free memory? }

thanks

no not need explicitly destroy or delete it. vector held value in class, destroyed automatically, , info within vector deleted vector's own destructor.

the term raii, , works well.

c++11 stdvector

Comments

Popular posts from this blog

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -