Ie. I want to code a class ADT that can be used like this:
myADT <type> objectA;
in the same way that someone would use a vector like:
vector <type> aVector;
I’m guessing maybe it has something to do with templates and overloading the <> operator, but how do I get it to take a data type as an argument?
Let’s say you have a class that implements your ADT using a hard-coded typedef
T:(You have to work out the internal storage and member functions that are appropriate for your actual ADT).
To change this so that you can specify
Tas done forstd::vectoretc.:Usage is then: