Things are even simpler if we use C++ modules. In that case, we donβt need to make separate .h and .cpp files. And the only thing we generally need to export other than the module itself is the class we are defining.
We may still wish to place the function definitions outside of the class. That way, the class definition has the minimal amount of code necessary and sticks to just what an βoutside userβ of the code should care about. The implementation details are there, but out of the way. But all of this code can go into a single file like Point.cxx:
It is still possible to separate the module into an interface file and an implementation file if we want to do so. However, with modules, there is not the same technical need to do so.