Possible Duplicate:
What does “operator = must be a non-static member” mean? (C++)
I'm trying to write an operator= method as a non member, with 2 arguments like this:
template<class T>
T operator=(T & t, const myclass<T>& m)
{
t = m.val;
return t;
}
But I get the error that operator= must be a nonstatic member. Is there a compiler flag or some way to trick the compiler to let me run this?
Thanks