1
vote
2answers
777 views

Best practice for creating a 'global' config class used by numerous components

I have a large project with a driver part and about 5 libraries doing various associated tasks. Many of the libraries require access to 'global' configuration data which is read from a database at ...
21
votes
6answers
5k views

Why the static data members have to be defined outside the class separately in C++ (unlike Java)?

class A { static int foo () {} // ok static int x; // <--- needed to be defined separately in .cpp file }; I don't see a need of having A::x defined separately in a .cpp file (or same file ...