C
C#4mo ago
goated

is there any sort of friend operator in c++ in c#?

.
2 Replies
TheBoxyBear
TheBoxyBear4mo ago
Not really but there is reflection to access members by string name. Theres also extension methods to mimick the syntax of instance methods Reflection is quite slow though compared to direct access You should also look into the internal access modifier that only grants access within the same assembly but is otherwise public.
life grinder
life grinder4mo ago
or you could try extract some stuff from your classes in such a way you don't need friend anymore maybe interface default implementations could help