Jump to content

  • Log In with Google      Sign In   
  • Create Account

#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