-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
In C++ you can take advantage of classes even you don't need to have members with the power of 'static' classes
You can write static functions, and they'll still abide by the public/private accessibility you set for them, and they can be called without even initializing the class:
class myClass { public: static bool DoSomething(); };
can be called like this:
myClass::DoSomething();
In serverImp.cpp there are many functions that are not declared in the header, but in the source file, this is not great because of two reasons:
- You have to call the functions in reverse, the functions have to be declared before the first call, this means the direction of where you are calling goes "up", which can be very confusing. If the functions you wrote can be private static functions of the server class, you can place the CALLER functions ABOVE the called ones, without having to declare a prototype inside the source file.
- The functions are in global scope, it is difficult to determine in a large project whether you're calling a function from another header, or calling a function from inside the class that you reside.
What I'm asking you to do here is to convert every function in serverImp.cpp into a private static function.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels