Why does Visual Studio C++ show private members in the IDE ???

R

Russell Mangel

Maybe someone could explain something that has been bothering me.

I noticed that when I create a class library, and then access the class
instance's member variables (from client), using the Visual Studio IDE (any
version) -> operator, all the private members are displayed.

Why is this so? I must assume that their is some rational reason why this is
a feature. I have tried to find a setting in the IDE to turn this off but I
can't seem to find the setting, so I am assuming this is the way it is
supposed to be.

What am I not understanding?

Thanks,

Russell Mangel
Las Vegas, NV
PS I have been wanting to ask this question for years, but I have never
asked.
 
B

Bruno van Dooren

I noticed that when I create a class library, and then access the class
instance's member variables (from client), using the Visual Studio IDE
(any version) -> operator, all the private members are displayed.
PS I have been wanting to ask this question for years, but I have never
asked.

given that anticipation, you will probably find my answer dissapointing.
Intellisense is pretty dumb. It will parse any header it can find to get
type information,
and then tries to show you as much as possible. that way it also works
inside the class where
you have accss to those variables.

you'll notice that it also show you classes and functions that you did not
actually include.
apart from local and global variables in you code, there is no link between
what intellisense shows you
and which functions you really have access to.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
R

Russell Mangel

Russell said:
given that anticipation, you will probably find my answer dissapointing.
Intellisense is pretty dumb. It will parse any header it can find to get
type information,
and then tries to show you as much as possible. that way it also works
inside the class where
you have accss to those variables.

Hmmmmm! I see.
Well at least now I can sleep better at night. This has been bugging me for
years, and I finally got the courage up to ask a "Potentially dumb"
question.

Thanks.
Russell Mangel
Las Vegas NV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top