A way to resolve this issue is how will these functions be used?
1) If all functions are used in one file and do not need to be exported anywhere, then be sure to use static functions. What for? Since you can simply enter them directly into the class body in a .cpp file, and you donβt have to worry about supporting declarations and maintaining parameter alignment. Since when analyzing a C ++ class, all the code inside each function defined inside the body of the class is skipped and then analyzed after all class members are declared, so the functions can see each other and better describe the situation. The compiler will also embed many smaller functions if you declare them directly in this class.
2) If you need to use functions from outside the current .cpp file, then use normal functions. Because later they can be used from anywhere in the world and it is easier to export them by name.
user1401452
source share