input validation

Max Samukha samukha at voliacable.com.removethis
Wed Mar 4 23:28:04 PST 2009


On Wed, 04 Mar 2009 12:14:53 -0800, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:

>Max Samukha wrote:
>> On Wed, 04 Mar 2009 10:27:55 -0800, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> 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.
>
>I am waiting a couple of days in release mode with all optimizations 
>turned on and wind from behind.
>Andrei

Ok



More information about the Digitalmars-d mailing list