C++ has so much stuff that I don’t know.
Is there any way to create a function within a class, that will always be called whenever any other function of that class is called? (like making the function attach itself to the first execution path of a function)
I know this is tricky but I’m curious.
Yes-ish, with a bit of extra code, some indirection and another class and using the -> instead of the . operator.
Well.. something roughly along those lines could be developed into a solution that I think would allow you to do what you want. What I’ve sketched out there probably won’t compile, but is just to give you a starting point.