O.k. this is so simple that it's embarrassing. I just can't seem to get it right. O.k. here's the basic stuff first:
- This is part of a class assignment, but this in itself is not THE assignment
- I'm not in any way asking for a cheat. The template function is already done and ready to hand in.
- The assignment involves the prototype and implementation of template functions
- Compiler = Visual C++ 6.0
O.k. so here's the issue. I can't seem to figure out how to properly call a template function in the main function. I know that this ought to be something simple, but @#$% if I'm not pulling out my hair trying to make it work. Here's a sample of my code:
All that I'm trying to do is simply call the template function n2front. I'm going crazy on this mostly because I know it ought to be simple. I am sure I am simply overlooking something.Code:#include <iostream> #include <queue> using namespace std; template <typename T> void n2front(queue<T>& q, int n); int main() { n2front(); //Here is where I just can't seem to call the template function correctly return(0); } template <typename T> void n2front(queue<T>& q, int n) { // Perform the needed function operation for the assignment }
Any helpful comments are greatly appreciated.
Thanks.