T
ThunderMusic
Hi,
I'm doing comparisons over arguments passed as Object... they can be of any
type, but must be comparable using < or >... unfortunatly, the compiler
does not give the possibility to compare 2 Object instances with < or >...
How can I do this without knowing the type of the objects?
Here's an example :
private void someMethod()
{
int m_X = 5;
float m_Y = 10.7f;
if (CompareGreaterThan(m_X, m_Y))
// DO STUFF
}
private bool CompareGreaterThan(object value1, object value2)
{
return (value1 > value2); // Here I can't do
}
thanks
ThunderMusic
I'm doing comparisons over arguments passed as Object... they can be of any
type, but must be comparable using < or >... unfortunatly, the compiler
does not give the possibility to compare 2 Object instances with < or >...
How can I do this without knowing the type of the objects?
Here's an example :
private void someMethod()
{
int m_X = 5;
float m_Y = 10.7f;
if (CompareGreaterThan(m_X, m_Y))
// DO STUFF
}
private bool CompareGreaterThan(object value1, object value2)
{
return (value1 > value2); // Here I can't do
}
thanks
ThunderMusic