Ecere SDK/eC Forums • View topic - subclassing Container




Ecere SDK/eC Forums

Ecere Developers Community

subclassing Container

General help with the eC language.

subclassing Container

Postby pber » Wed Oct 22, 2014 7:29 pm

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

Re: subclassing Container

Postby jerome » Wed Oct 22, 2014 8:21 pm

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

Re: subclassing Container

Postby pber » Wed Oct 22, 2014 8:40 pm

Hi Jerome,
probably I touched too much things by subclassing Container.
Reassured for Canadian people too.
p.
pber
 
Posts: 17
Joined: Mon Aug 18, 2014 2:09 am


Return to eC Language

Who is online

Users browsing this forum: No registered users and 3 guests

cron