digitalmars.D.learn - TDPL question: "objects may not embed internal pointers", classes too?
- Adam D. Ruppe (6/6) Mar 16 2014 On page 249 of TDPL (Andrei's book), in a section on structs and
- Frustrated (7/13) Mar 16 2014 And object is an instantiation of a class. I guess it could be
On page 249 of TDPL (Andrei's book), in a section on structs and postblits, it says "D objects must be relocatable" and other similar statements while banning internal pointers. I knew this applies to structs and the context makes that plainly clear, but the word "object" is a bit ambiguous: does this apply to classes too?
Mar 16 2014
On Sunday, 16 March 2014 at 18:41:51 UTC, Adam D. Ruppe wrote:On page 249 of TDPL (Andrei's book), in a section on structs and postblits, it says "D objects must be relocatable" and other similar statements while banning internal pointers. I knew this applies to structs and the context makes that plainly clear, but the word "object" is a bit ambiguous: does this apply to classes too?And object is an instantiation of a class. I guess it could be ambiguous but generally I think object = class(misnomer but simple). Structs can exist on the heap and be very similar to objects and I suppose it is possible to allocate classes on the stack so theoretically I guess it is ambiguous but in programming parlance it is not.
Mar 16 2014