POV-Ray : Newsgroups : povray.beta-test : 3.7.0RC3 -- make check -- how long should the test run? : Re: 3.7.0RC3 -- make check -- how long should the test run? Server Time
5 Jul 2022 23:58:29 EDT (-0400)
  Re: 3.7.0RC3 -- make check -- how long should the test run?  
From: clipka
Date: 21 Jun 2011 15:30:26
Message: <4e00f152@news.povray.org>
Am 21.06.2011 20:36, schrieb Le_Forgeron:

> I wonder a bit about the construct
>
> 		while ( !Stream.eof() )
> 		{
> 			// get and preprocess line
> 			std::getline(Stream, line);
> 			line = pre_process_conf_line(line);
> 			++line_number;
>
> 			// skip empty line
> 			if(line.length() == 0)
> 				continue;
>
> If the last line is length 0, would the eof() be evaluated (again) ?

The C/C++ language construct

     while ( <CONDITION_1> )
     {
         <STATEMENTS_A>
         if ( <CONDITION_2> ) continue;
         <STATEMENTS_B>
     }

is fully equivalent to

     while ( <CONDITION_1> )
     {
         <STATEMENTS_A>
         if ( ! <CONDITION_2> )
         {
             <STATEMENTS_B>
         }
     }


Post a reply to this message

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