G
Gene Wirchenko
Dear CSharpies:
Suppose that I have two classes. Call them One and Two. I wish
to define addition between them.
For the static version, I can code
class One
{
...
public static ResultType operator +(One LHS, Two RHS)
{
// Addition definition goes here.
}
...
but I can also do this for Two. Which should I pick? What if I do it
for both?
A pointer to what I should and should not do, please.
Sincerely,
Gene Wirchenko
Suppose that I have two classes. Call them One and Two. I wish
to define addition between them.
For the static version, I can code
class One
{
...
public static ResultType operator +(One LHS, Two RHS)
{
// Addition definition goes here.
}
...
but I can also do this for Two. Which should I pick? What if I do it
for both?
A pointer to what I should and should not do, please.
Sincerely,
Gene Wirchenko