On Wed, 04 Mar 2009 10:27:55 -0800, Andrei Alexandrescu <[email protected]> wrote:
>Max Samukha wrote: >> >> If you intruduce a dummy type, why not make it perform validation in a >> debug build when sumthing like debug=slowButSafe is set? > >Because in the case of binarySearch slowButSafe quickly becomes >slowAndUseless. It's happened to me - I had an assert(isSorted) in >binary search (I guess it's in one of the older phobos releases!) and >when I was using the debug version, my program would take forever to run. > >A debug build should at most change the constant multiplying the >complexity, not the complexity. > > >Andrei I intentionaly proposed a special debug mode, not regular asserts, which are on in any debug build. I would like, knowing that I can wait a couple of days to make sure my program is correct, to be able to turn on validation.
