Ecere SDK/eC Forums
http://ecere.com/forums/
Print view

subclassing Container
http://ecere.com/forums/viewtopic.php?f=1&t=395
Page 1 of 1
Author:  pber [ Wed Oct 22, 2014 7:29 pm ]
Post subject:  subclassing Container

Hi Jerome,
does class_fixed relates in some way with class instanciation?

I'm refactoring my AST class as subclass of Container.
When AstNode was not a son of Container this worked well:

Code: Select all

class Literal : AstNode {
   Value data{};
   ...
}
...but now I find data uninited.
Any idea about what i'm missing?

PS
Are truth the voices that Canada is going to become musulman?
Author:  jerome [ Wed Oct 22, 2014 8:21 pm ]
Post subject:  Re: subclassing Container

Hi Paolo,

class_fixed instruct the eC compiler to hardcode the data layout of the class and is mostly meant for the core eC library and for extra performance, and as such should not be required in user level code.

Instanstiation of a class should always be initialized, and instantiation of a struct should always be initialized if it is instantiated with the brackets { }, or if it is an instance member of another class that is being initialized.

I can't really guess what's going on with your code unless you show me more code to look at :D

Hmm no Canada will not turn musulman :)

Regards,

-Jerome
Author:  pber [ Wed Oct 22, 2014 8:40 pm ]
Post subject:  Re: subclassing Container

Hi Jerome,
probably I touched too much things by subclassing Container.
Reassured for Canadian people too.
p.
All times are UTC-05:00 Page 1 of 1