subclassing Container

General help with the eC language.
Post Reply
pber
Posts: 17
Joined: Mon Aug 18, 2014 2:09 am

subclassing Container

Post by pber »

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?
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: subclassing Container

Post by jerome »

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
pber
Posts: 17
Joined: Mon Aug 18, 2014 2:09 am

Re: subclassing Container

Post by pber »

Hi Jerome,
probably I touched too much things by subclassing Container.
Reassured for Canadian people too.
p.
Post Reply