POV-Ray : Newsgroups : povray.off-topic : Saw a weird C++ construct I'm not sure I understand... : Re: Saw a weird C++ construct I'm not sure I understand... Server Time
7 Sep 2024 03:21:21 EDT (-0400)
  Re: Saw a weird C++ construct I'm not sure I understand...  
From: Nicolas Alvarez
Date: 20 Aug 2008 22:19:06
Message: <48acd09a@news.povray.org>
Darren New wrote:
> 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?

There is also the chance that assert is a macro making god knows what
hackish stuff :)


Post a reply to this message

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