static function in a ref class

Hello,

In a ref class, there is a function as:
bool operator>(double value, CBox^ box)
{ return value > box->volume();}
when I compile it, the error is:
error C2333: 'CBox::operator >' : error in function declaration; skipping function body
error C2804: binary 'operator >' has too many parameters

when I put 'static' as:
static bool operator>(double value, CBox^ box)
when I compile it, it's good.

Could you tell me why, how does 'static' work here?
Thank you.
closed account (z05DSL3A)
It is because C++/CLI requires that overloaded operators be static.
Topic archived. No new replies allowed.