S
Steve
Is there a way to dynamically inspect a type for the operators it
implements, and then compare two objects implementing that type?
Basically I'm looking at a situation where I receive two variables that
need to be compared, but they are boxed as type object. The only way I
have found that I can currently compare them is to use a case statement
to determine their type, cast them to the type, and then compare them.
This would be find if I only had to deal with the stock value types, but
there are custom types in the application, and that would mean writing
the necessary checks for each custom type.
Is it possible to do it all automagically?
Thanks,
Steve
implements, and then compare two objects implementing that type?
Basically I'm looking at a situation where I receive two variables that
need to be compared, but they are boxed as type object. The only way I
have found that I can currently compare them is to use a case statement
to determine their type, cast them to the type, and then compare them.
This would be find if I only had to deal with the stock value types, but
there are custom types in the application, and that would mean writing
the necessary checks for each custom type.
Is it possible to do it all automagically?
Thanks,
Steve