I’m looking for one special access level like friendship in c# for one member of my class M that I cannot find here :
http://msdn.microsoft.com/en-us/library/ba0a1yw2.aspx
Question 1:
Assume I have a secret value like password in my class M, that I don’t want any object to have access to it, but for some reasons I want only other instance of class M can read and use this value like:
m1.similarity(m2) ==> calculate similarity between m1.password and m2.password
Question 2:
If there is no way to implement the previous example, is it possible to define a friend class like below :
anotherclass.similarity(m1,m2)
p.s: This is just an example to make the question clear and I know about possible security impact of method similarity()
Thanks every one, I finally solved the problem with a helper method like this :