Hi,
I am building up a static function library for use both in BP and c++, and I was wanting to use one of the static lib member funcs in my c++ pawn class.
Now I know I need to create an instance of the static lib object in order to invoke it’s member funcs… but I was curious if it was more *efficient *to create the instance in the ‘begin play’ of the pawn or to create the instance in the pawn’s member function where I specifically want to use the static lib func.
and I realized that setting the (edit: didn’t mean to use the word virtual here) member functions to static allowed me to then do what you said (I was tripping a break trying to create an instance of the static lib class so I had to do some digging).
Would you be so kind as to explain as to why making it a virtual is useful and what does the ‘~’ do in that case as a prefix?
The ‘~’ character denotes the destructor of the class. I don’t think you actually need it, I usually add it just in case I need it later.
It’s virtual so that any derived class destructors are called in order when a pointer to a base class is deleted.