Could some please give me an example of the class function prototype for an overloaded = operator when there are two templates involved? For example: Let's say the code is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
template <class T1, class T2>
struct nodeType
{
T1 item1;
T2 item2;
nodeType<T1, T2> *link;
};
template<class T1, class T2>
class LL
{
public:
...
};
How would one write a function prototype for an overloaded = operator? I hope I've explained my question clearly and provided enough information...
What's important is that the class name includes the template arguments. For an overloaded assignment operator, you most likely not need additional specifications. Your data member link shows a good example.
Also remember that all class/function definitions and prototypes that require template arguments require that you put template<foo, bar, ...> beforehand. Don't forget it like I just did and have to edit my post.