Skip to content

Instantly share code, notes, and snippets.

@FONQRI
Created December 30, 2017 08:05
Show Gist options
  • Save FONQRI/0a25b964b6d60cd32820f0dc158d0023 to your computer and use it in GitHub Desktop.
Save FONQRI/0a25b964b6d60cd32820f0dc158d0023 to your computer and use it in GitHub Desktop.
this is a simple vector code
#include <memory>
#include <vector>
class Test {
public:
Test() { std::clog << "created" << std::endl; }
~Test() { std::clog << "destroid " << std::endl; }
int value = 56;
};
int main()
{
std::clog << "simple : " << std::endl;
std::vector<Test> smpleVector;
Test st1;
smpleVector.push_back(st1);
Test st2;
smpleVector.push_back(st2);
Test st3;
smpleVector.push_back(st3);
Test st4;
smpleVector.push_back(st4);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment