Topic: Error in standard?


Author: stephen.clamage@sun.com (Steve Clamage)
Date: 1999/01/25
Raw View
stanley@West.sun.com (Stanley Friesen [Contractor]) writes:

>I just noticed a possible defect in the standard this morning.

>In the section on iteration statements, it is stated in the description
>of the do-statement that the condition is converted to bool, but this is
>NOT stated for the other two types of iteration statement.  I think
>this is not intended.  It would be sufficient to add such a statement to
>the description of the while-statement since the for-statement is defined
>in terms of it.

>Or am I missing something?

Yes. You are missing the note at the end of 6.5, where it refers
you to section 6.4 for the meaning of "condition".

The "do" statement does not have a "condition" in it; it has an
"expression". The "for" and "while" statements have "conditions",
and so are covered by the definition in section 6.4.

--
Steve Clamage, stephen.clamage@sun.com


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: stanley@West.sun.com (Stanley Friesen [Contractor])
Date: 1999/01/25
Raw View

I just noticed a possible defect in the standard this morning.

In the section on iteration statements, it is stated in the description
of the do-statement that the condition is converted to bool, but this is
NOT stated for the other two types of iteration statement.  I think
this is not intended.  It would be sufficient to add such a statement to
the description of the while-statement since the for-statement is defined
in terms of it.

Or am I missing something?


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]