How do I create two codes from one source?
Posted on 2000-02-19
I want to maintain a debug code and a production code within one file. Performance is critical and hence
I don't want the production code cluttered with
conditional statements. In C I would use #defines,
but my understanding is that there are more elegant
solutions in C++..
To be specific, the debug code will maintain a second
array and return an additional output. I don't want the
second array to even exist in the production code.
Ideally I would like to be able to link the debug and prodcution codes in the same executable so that
I can run both codes and assert that they both
produce the same answers.