POV-Ray : Newsgroups : povray.off-topic : Saw a weird C++ construct I'm not sure I understand... : Saw a weird C++ construct I'm not sure I understand... Server Time
7 Sep 2024 03:20:38 EDT (-0400)
  Saw a weird C++ construct I'm not sure I understand...  
From: Darren New
Date: 20 Aug 2008 12:23:50
Message: <48ac4516@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.