Maybe the best variant is when the use calls look that simple, but, at compiler level, they are instantiated with real code or with stubs, depended on compiler directives. So all these #if are concentrated in declaration source. In a project, we used this in a variant with two level axes, so, for example, DEBUG_MIN is compiled always (with runtime check) but DEBUG_MAX if log set is >=MAX during compilation.
For regrets on preprocessor, the main problem with it is not preprocessing itself - but its low level (just textual replacement). Common LISP is fundamentally based on preprocessor but it is really high-level, with content analyzer. If an analog was added to C++, most of template magic wouldn't be needed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Maybe the best variant is when the use calls look that simple, but, at compiler level, they are instantiated with real code or with stubs, depended on compiler directives. So all these
#if
are concentrated in declaration source. In a project, we used this in a variant with two level axes, so, for example, DEBUG_MIN is compiled always (with runtime check) but DEBUG_MAX if log set is >=MAX during compilation.For regrets on preprocessor, the main problem with it is not preprocessing itself - but its low level (just textual replacement). Common LISP is fundamentally based on preprocessor but it is really high-level, with content analyzer. If an analog was added to C++, most of template magic wouldn't be needed.