Move debug functions to two DLL's
To answer your question, this is a fine way to do what you're attempting to do. OS vendors will often do something similar where they ship the release versions of their frameworks to end users, and developers can sometimes download debug versions that do more bounds checking and output more verbose messages when given bogus inputs. This allows developers to run additional tests of their own apps to ensure they aren't giving bad values to the OS when calling it.

I also appreciate that now the code can be written inline without a bunch of #ifdef BLAH statements around it or even if (debug) {} statements. I would definitely make sure that calling the release versions which do nothing doesn't slow down any critical inner loops in your processing, though. It's not real likely, but can happen on occasion.

As for a review, I did notice a few really minor things:

You have this line of code in testFuncs(): 

std::cout &lt;&lt; "funci() returned " &lt;&lt; test() &lt;&lt; std::endl;


What is funci()? Shouldn't the displayed text be "test() returned "? As I say, it's minor, but I was confused while reading it.

I'd also avoid putting an if statement on the same line as its body like you do here:

if(status) { return status; }


When debugging, you'd hit that line, and if status is non-zero the app will suddenly quit when you step over the line. I know if that happened to me, I wouldn't immediately know what had just happened the first time I saw it. Having it on the next line would cause me to step into the body and see that the value is bad. I could then examine what it was before the app quit and the state went away. As I said, very minor, but just thought I'd mention them.