I've got a bunch of functions(func1(),func2(),...) in a header file to which I want to give some scope. I know of 2 implementations:
class bunchOfFunctions { public: static void func1(); static void func2(); ... };
namespace bunchOfFunctions { void func1(); void func2(); ... };
In both the options, I can access the functions in the same way i.e. by bunchOfFunctions::func()
. I prefer the namespace method(lesser typing), but I've seen the 1st method of implementation also at my workplace.
Which option is better? Is there any other option?