To do this, you need a templated assignment operator, like this:
template <typename T>
class Item {
/* more */
public:
template <typename U>
Item &operator=(const Item<U> &ref)
{
Data = ref.Data;
return *this;
};
/* more */
};
In addition to that, you might need or want a templated copy constructor:
template <typename U>
Item(const Item<U> &ref):
Data(ref.Data)
{
};
This allows for:
Item<int> foo;
Item<float> bar(foo);