I know that namespace are preferred in C++ if you want to define static functions, but what to do when you have functions which access other functions but the other functions should be private and not be accessible by others. How to declare/define it ? Wouldn't it be much simple to use classes ? Or do I have to still use namespaces ?
Like this:
class Test1
{
public:
static void Start()
{
if(1) // Some checks...
{
ProcessStart();
}
}
private:
static void ProcessStart()
{
if(!Initialized)
{
//Initialize
}
// Do other stuff
}
static bool Initialized;
};
bool Test1::Initialized = false;