|
|
On Wed, 20 Aug 2008 18:23:49 +0200, Darren New <dne### [at] sanrrcom> wrote:
> 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 do not see why it would not.
--
FE
Post a reply to this message
|
|