nested classes

S

Samee Zahur

I know that these beasts are better avoided ... but I'm just curious...

are outer<int>::inner and outer<float>::inner the same? (let's say
outer is a template class) what if inner has a static member var? Is it
shared with all inners?

And what if an inner class is defined with private access ... what does
it mean? Can outsiders access that vars of that type without declaring
one ... or should they never even see any variable of that type
anywhere in their code?

Samee
 
V

Victor Bazarov

Samee said:
I know that these beasts are better avoided ... but I'm just
curious...

are outer<int>::inner and outer<float>::inner the same? (let's say
outer is a template class) what if inner has a static member var? Is
it shared with all inners?
No.

And what if an inner class is defined with private access ... what
does it mean? Can outsiders access that vars of that type without
declaring one

Not unless they are declared 'friend'.
... or should they never even see any variable of that
type anywhere in their code?

Not sure what you mean.

V
 
S

Samee Zahur

Not sure what you mean

Never mind, you replied enough. I got my answer, thanks!

Samee
 

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

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,666
Latest member
selsetu

Latest Threads

Top