www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Struct spec question

reply Lars Ivar Igesund <larsivar igesund.net> writes:
What is meant by the comparison table on the struct page, when it is said
that classes can have hidden members, whereas structs cannot, and at the
same time, structs can have member protection. That is, what is the meaning
of hidden members and member protection respectively, seen in conjunction
with each other?

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango
Jul 20 2007
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Lars Ivar Igesund wrote:
 What is meant by the comparison table on the struct page, when it is said
 that classes can have hidden members, whereas structs cannot, and at the
 same time, structs can have member protection. That is, what is the meaning
 of hidden members and member protection respectively, seen in conjunction
 with each other?

Maybe it's talking about the _vtbl pointer of a class? --bb
Jul 20 2007
next sibling parent BCS <ao pathlink.com> writes:
Reply to Bill,

 Lars Ivar Igesund wrote:
 
 What is meant by the comparison table on the struct page, when it is
 said that classes can have hidden members, whereas structs cannot,
 and at the same time, structs can have member protection. That is,
 what is the meaning of hidden members and member protection
 respectively, seen in conjunction with each other?
 

--bb

That would be my guess. struct: If you don't say to put it there, it's not there. Class: no such luck, class vtbl + interface vtbl's + mutex + whatever W wants
Jul 20 2007
prev sibling parent Sean Kelly <sean f4.ca> writes:
Bill Baxter wrote:
 Lars Ivar Igesund wrote:
 What is meant by the comparison table on the struct page, when it is said
 that classes can have hidden members, whereas structs cannot, and at the
 same time, structs can have member protection. That is, what is the 
 meaning
 of hidden members and member protection respectively, seen in conjunction
 with each other?

Maybe it's talking about the _vtbl pointer of a class?

Sounds right. Inherited members then? Sean
Jul 20 2007