title: Should a library build system turn off asserts by default?
body: <p>I'm writing a library with many asserts. The library is much slower with asserts turned on and the whole point of the library is that it is fast, so the asserts only make sense when testing or diagnosing a bug. I'm using autoconf and it seems to be standard practice to require the user to know about this issue and pass a flag to configure to disable asserts. In that case only an expert user will know enough to install an appropriate version of the library! Is that really what I should do, and if so, are there good reasons for that beyond just "that's what expert users and other programmers will expect?"</p>
  
  <p><strong>Edit:</strong> <a href="http://old.nabble.com/C++,-assert-and-NDEBUG-td28052920.html" rel="nofollow">Here's</a> an example of a discussion stating that you should not define NDEBUG by default in release mode, though with no other reason given that it is surprising to do that.</p>