C
C#10mo ago
goated

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

.
2 Replies
TheBoxyBear
TheBoxyBear10mo 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.
Omnissiah
Omnissiah10mo 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
Want results from more Discord servers?
Add your server