Possible Duplicate:
Why const parameters are not allowed in C#
I am a C++ developer and I had some experience using C#.
I have always wondered why there is nothing like this in C#:
bool MyFunction(const AnotherClass& x)
{
//some stuff
}
I personally think that the constness is one of the best features in C++ (it helps the developer to increase encapsulation and decoupling). One of the suggestion of Sutter (C++ Coding Standards: 101 Rules, Guidelines, and Best Practices) is never return your handlers, if I cannot pass by const reference I am giving away the entire class not just the handlers.
Is it my lack of knowledge on C#? There is anything like that in C#? If not, why is C# not using it?