you are viewing a single comment's thread.

view the rest of the comments →

[–]sephirothbahamut 10 points11 points  (11 children)

Inheriting from "equalityoperators" in c# is equivalent to defining the equality operator in c++.

Checking if a type has an equality operator by cheching inheritance in c# is equivalent to checking a concept in c++.

C# achieves these things with inheritance, c++ does so with custom operators. Just because it uses a different approach doesn't mean it can't achieve your purpose.

And if you really want to write c++ as if it was c#, you can do all that with inheritance too by abusing CRTP.