I am learning templates in C++, and a problem on my homework asks me the following:
//Use the template below to answer the questions and create C++ functions:
template<class T> void enemyAdjust(T objparm)
{
objparm.moveposition();
objparm.fireweapon();
}
//Write one line of code to prototype a template function using type: RapidDog
What does this even mean? I've tried typing void enemyAdjust(RapidDog)
and its variations, as well as others, but none of them seem to be right. What is it asking for? I understand the basics of template functions, and can write one, but I just don't understand the question or what I'm supposed to do.
Note: It's an online homework; it tells you whether you got it right or wrong and then asks you to try again to continue.