cpp_class(#[derive(PartialOrd, Ord, PartialEq, Eq)] unsafe struct MyClass as "MyClass" )
And these trait are implemented to call the operator ==, or <.
Note that contrary to Clone and Default, which are automatically implemented, these are explicit.
The reason why one need to explicitly declare them is that the C++ operators might not have the right semantic for the traits. Else, we could do it automatically, using SFINAE to detect if a==b
The question is weather one should change the Clone and Default trait to be also explicit? I think it is fine that it is automatic since this is almost always what one wants.
So we can do
And these trait are implemented to call the operator ==, or <.
Note that contrary to Clone and Default, which are automatically implemented, these are explicit. The reason why one need to explicitly declare them is that the C++ operators might not have the right semantic for the traits. Else, we could do it automatically, using SFINAE to detect if
a==b
The question is weather one should change the Clone and Default trait to be also explicit? I think it is fine that it is automatic since this is almost always what one wants.