Question
// I am going to match the names that STL uses so you don't get confused in the real world. I'm skipping operator [] for
// I am going to match the names that STL uses so you don't get confused in the real world. I'm skipping operator [] for a specific reason that // doesn't come up for a few weeks.
template
T mUndefined;// Lots of STL functions say that doing something naughty gets "undefined behavior". It could throw, crash, make you eggs, or return nonsense. // Return this undefined one if anybody ever tries to go out of bounds.
public: Vector()// O(1) { mSize = 0; mData = nullptr; Reserve(15); } // Big 3 ~Vector() { // Free all memory } Vector(const Vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started