You can structure a C++ program so that (almost) all the code resides in Header files. It essentially looks like a C# or Java program. However, you do need at least one
static-or-global-variable kludges even less transparent, perhaps un-debuggable.
for example counting the total number of iterations for analysis.
In MY kludged files putting such items at the top of the cpp file makes them easy to find.
By "perhaps un-debuggable", I mean that routinely I will put such a global into the WATCH window. Since it's always-in-scope the WATCH window can always get to it no matter where the program counter happens to be right now. By putting such variables outside a {} at the top of a header file you would let all downstream code "see" them. By putting them INSIDE a {}, offhand I would think the debugger will no longer consider them "in-scope" if your program-counter is outside the {}. Whereas with the kludge-global-at-Cpp-top, even though it might be global to the extent of showing up in your link-map-pdb-etc, without an extern-statement the other Cpp files can't get to it, avoiding accidental coupling.