|
|
I saw a bit of a note describing how to use an "assert" and a "check"
call in some C++. "Assert" would exit the program if it failed, and
"check" would let the program continue after logging in order to look
for more failures.
But the invocation was along the lines of
assert(x < 10) <<
"The value x is " << x << " but that's too small";
The only way I can see this working is if assert returns either a
subclass with operator<< defined to do nothing, or with operator<<
defined to log something. In the latter case, the destructor would exit
the program? Would that work?
I think to figure out C++, I need to figure out where all the invisible
method invocations are that the compiler inserts for you. That would
seem to be my biggest stumbling block right now.
--
Darren New / San Diego, CA, USA (PST)
Post a reply to this message
|
|