Quote Originally Posted by Russco View Post
With templates, you cant split the code into .h and .cpp files like you can with non-templates without export which virtually no compiler supports, or ever will, though comeau does.

When you include the .h in a file and try to use the templated function, the compiler tries to instantiate the template substituting the generic type(s) for specific type(s) but it cannot do that unless it can see the definition of the template.
This must be the issue. Thanks for this information. Frustrating since the instructor wants us to do it this way. Class header and class .cpp file. And I am using the templated function in another class .cpp file, for example I have a world class that uses the predator class. All different files of course.
ie. predator.h, predator.cpp, world.h, world.cpp