assert(condition[, message]) patch
Chris Miller
chris at dprogramming.com
Wed May 31 15:07:19 PDT 2006
On Wed, 31 May 2006 17:55:51 -0400, Walter Bright
<newshound at digitalmars.com> wrote:
> Chris Miller wrote:
>> On Wed, 31 May 2006 13:01:24 -0400, Walter Bright
>>> ? You'll need to go look at the source anyway when the assert trips,
>>> so what advantage is there to print the comment?
>> How about when you have many versions of the program and source. Sure
>> if you backup regularly and save them all you can eventually figure out
>> which assert, but a message usually lets you find it in seconds.
>
> I'm not sure what there is to figure out, it gives the source file and
> line number. If you're using a decent IDE, it'll even automatically
> bring up the source file and position the cursor on the offending line.
>
"How about when you have many versions of the program and source" ==
source files have been modified; lines don't "line up" unless you
coordinate the version and dig it up.
More information about the Digitalmars-d
mailing list