A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue272 below:

Issue 272: Missing parentheses around subexpression

This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.

272. Missing parentheses around subexpression

Section: 31.5.4.4 [iostate.flags] Status: CD1 Submitter: Martin Sebor Opened: 2000-11-02 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [iostate.flags].

View all issues with CD1 status.

Duplicate of: 569

Discussion:

27.4.4.3, p4 says about the postcondition of the function: If rdbuf()!=0 then state == rdstate(); otherwise rdstate()==state|ios_base::badbit.

The expression on the right-hand-side of the operator==() needs to be parenthesized in order for the whole expression to ever evaluate to anything but non-zero.

Proposed resolution:

Add parentheses like so: rdstate()==(state|ios_base::badbit).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4