Is there any way to make a class template function?
So for example
//Warning: this is conceptual pseudo-code
template<typename TemplateClass, TemplateItem>
TemplateClass &TemplateClass::operator=(TemplateItem &B)
{
Item = B.Item;
return *this;
}
//or...
template<typename TemplateClass, TemplateItem>
TemplateClass &TemplateClass::Assignment(TemplateItem &B)
{
Item = B.Item;
return *this;
}
Assignment<TestA,TestB>(B);
Or something along those lines.
It isn’t just for assignments, I’ll comment.
I’m sure I’ll get bashed by the “preprocessor is evil” group, but I think you are looking for something like this: