You must follow the rules as below:
1. do not use any static variables
2. do not use any variables which is not inside a function
3. only new, operator new, delete and operator delete are allowed to allocate or deallocate memory
4. memory usage limit: 16384 byte
You are required to implement a vector.
You have to enable C++11 in this problem. (e.g. "g++ -std=c++11 ...")
There are seven functions in Vector that you have to implement, the functionality is as below:
For all testcases, you have to deal with reserve() and whatever is not explicitly mentioned below;
For the first testcase, you only need to deal with insert();
For the second and third, you only need insert() and erase();
For the fourth, you may only omit copy assignment;
For all, you need to do all.
Complete a Vector (default constructor, copy constructor, copy assignment operator, erase, insert, reserve and destructor).