This sounds good and will work well. There are some things to consider.
Private static functions can be made even more private. If you simply placed them in a .cpp file as free functions (not in a class, but ideally in an "unnamed namespace"), then they will not appear in the .h file. This would be beneficial because another .cpp file that your class uses will not see these private static variables. This will speed up compilation time. In addition, it will allow you to freely change the functions in the .cpp file, and if you make any changes, other files using the .h file will not need to be recompiled with each change, because you do not have to change .h to change these functions.
Secondly, sometimes static functions can make writing unit tests difficult. If you have an X class that uses these static functions, it is difficult to isolate the X class from static functions if you want to test the X class. If you used non-static methods instead and defined an interface class which class you are writing, you can more it’s easy to use the “inverse control” and “dependency injection” methods to write unit tests for your classes. I will not explain these methods here, as there are many good descriptions that already float on the Internet.
source share