Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualParadigm Shifter

Posted 24 March 2013 - 01:57 PM

Not sure.

 

It's safe because it doesn't use the this pointer and isn't virtual. It would be better off being static though, as soon as you use the this pointer or make it virtual it will crash.

 

Non-static member functions are just name mangled functions which have an implicit this pointer passed as an argument.

 

EDIT: i.e. there is no pointer derefernce going on. It just compiles to CallSomeNameMangledFunction(nullptr); Virtual functions are different they compile to this->vtbl.VirtualFunc(this); so there is a dereference going on.


#2Paradigm Shifter

Posted 24 March 2013 - 01:55 PM

Not sure.

 

It's safe because it doesn't use the this pointer and isn't virtual. It would be better off being static though, as soon as you use the this pointer or make it virtual it will crash.

 

Non-static member functions are just name mangled functions which have an implicit this pointer passed as an argument.

 

EDIT: i.e. there is no pointer derefernce going on. It just compiles to CallSomeNameMangledFunction(nullptr); Virtual functions are different they compile to this->vtbl->VirtualFunc(this); so there is a dereference going on.


#1Paradigm Shifter

Posted 24 March 2013 - 01:53 PM

Not sure.

 

It's safe because it doesn't use the this pointer and isn't virtual. It would be better off being static though, as soon as you use the this pointer or make it virtual it will crash.

 

Non-static member functions are just name mangled functions which have an implicit this pointer passed as an argument.


PARTNERS