Question: Finish // TODO: Your code here Only. C++ #include #include #include // template class MyVector { public: /******************* * Static constants ******************/ /// Default capacity

Finish // TODO: Your code here Only. C++

#include #include #include

// template class MyVector { public: /******************* * Static constants ******************/ /// Default capacity static constexpr size_t DEFAULT_CAPACITY = 64; /// Minimum capacity static constexpr size_t MINIMUM_CAPACITY = 8; /***************************** * Constructors / Destructors ****************************/ /// Normal constructor MyVector(size_t capacity = MyVector::DEFAULT_CAPACITY) { // TODO: Your code here

} /// Copy constructor MyVector(const MyVector& other) { // TODO: Your code here

} /** * Destructor * Should call clear() so each element gets its destructor called. * Then, de-allocate the internal array and make it a nullptr, if its not already a nullptr. */ ~MyVector() {

// TODO: Your code here } /************ * Operators ************/ /// Assignment operator MyVector& operator=(const MyVector& rhs) { // TODO: Your code here } /// Operator overload to at() T& operator[](size_t index) const { // TODO: Your code here } /************ * Accessors ************/ /// Return the number of valid elements in our data size_t size() const { // TODO: Your code here } /// Return the capacity of our internal array size_t capacity() const { // TODO: Your code here }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!