How do I write a template with three typename variables, so that from main I can use that template as a vector, to add and later go back or go forward in the vector and then view the content of the vector in that location?
Here what I've came up with
I want to use the AClass, as the template of adding to the vector. I am trying to write three functions, one to view the vector, one to go forward in the vector and one to go back. I would really appreciate your help?
Thanks,
John
Here what I've came up with
Code:
template <typename avar, typename bvar, typename cvar>
class AClass {
public:
avar var1;
bvar var2;
cvar var3;
AClass (const avar& var1, const bvar& var2, const cvar& var3): avar(var1), bvar(var2), cvar(var3) {}
};
//main program
vector <AClass> avector;
Thanks,
John
Comment