When working with native c++ in Visual Studio, intellisense shows private members and functions even when outside the scope of the containing class. This makes it hard to create clean APIs for the classes I write.
Is there a reason for this? Can this be prevented?
Well, why shouldn’t it show the private ones as well? They are members, after all, they exist and they are perfectly accessible from certain contexts, just like any other members.
It would be very difficult for the IntelliSense to determine whether the members are accessible or not from this specific context, especially if you take into account that in most cases this context is not yet complete (the user is still typing it up), meaning that it is generally impossible to analyze it.