Prev: how to convert integer to string
Next: reinterpret_cast
From: bokiteam on 8 Jan 2006 19:50 Thanks for information :) Best regards, Boki.
From: Ralph D. Ungermann on 10 Jan 2006 09:42 James Dennett wrote: > Interesting: I much prefer that to the modern practice of > writing assert(false) in theoretically unreachable places. Ever tried something like assert( !"Oops: Can't remove object -- list is empty." ); The assert macro prints the offended expression. So you'll get some sorce code documentation and a useful message for free! Ralph
From: Mike Wahler on 10 Jan 2006 11:14 "Ralph D. Ungermann" <ungermann(a)z.zgs.de> wrote in message news:dq0h6h$2vns$1(a)news.LF.net... > James Dennett wrote: >> Interesting: I much prefer that to the modern practice of >> writing assert(false) in theoretically unreachable places. > > Ever tried something like > > assert( !"Oops: Can't remove object -- list is empty." ); > > The assert macro prints the offended expression. So you'll get some sorce > code documentation and a useful message for free! But the above does not test for the offending condition. -Mike
From: osmium on 10 Jan 2006 11:23 "Mike Wahler" writes: > "Ralph D. Ungermann" <ungermann(a)z.zgs.de> wrote in message > news:dq0h6h$2vns$1(a)news.LF.net... >> James Dennett wrote: >>> Interesting: I much prefer that to the modern practice of >>> writing assert(false) in theoretically unreachable places. >> >> Ever tried something like >> >> assert( !"Oops: Can't remove object -- list is empty." ); >> >> The assert macro prints the offended expression. So you'll get some sorce >> code documentation and a useful message for free! > > But the above does not test for the offending condition. No need to test. He is already in an unreachable place, that was part of the set up. It's new to me and I like it!
From: Mike Wahler on 10 Jan 2006 11:31 "osmium" <r124c4u102(a)comcast.net> wrote in message news:42i5ccF1j2uuaU1(a)individual.net... > "Mike Wahler" writes: > >> "Ralph D. Ungermann" <ungermann(a)z.zgs.de> wrote in message >> news:dq0h6h$2vns$1(a)news.LF.net... >>> James Dennett wrote: >>>> Interesting: I much prefer that to the modern practice of >>>> writing assert(false) in theoretically unreachable places. >>> >>> Ever tried something like >>> >>> assert( !"Oops: Can't remove object -- list is empty." ); >>> >>> The assert macro prints the offended expression. So you'll get some >>> sorce code documentation and a useful message for free! >> >> But the above does not test for the offending condition. > > No need to test. He is already in an unreachable place, that was part of > the set up. OK, apparently I wasn't sure of context. > It's new to me and I like it! Me too. -Mike
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: how to convert integer to string Next: reinterpret_cast |