A RetroSearch Logo

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

Search Query:

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

Issue 3675: std::ios_base::iword/pword might be misspecified

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

3675. std::ios_base::iword/pword might be misspecified

Section: 31.5.2.6 [ios.base.storage] Status: New Submitter: Jiang An Opened: 2022-02-14 Last modified: 2022-03-04

Priority: 4

View all other issues in [ios.base.storage].

View all issues with New status.

Discussion:

Currently 31.5.2.6 [ios.base.storage] p5 and p8 say "On failure, a valid long&/void*& initialized to 0". Such wording seems wrong, because a long&/void*& variable or return value can't be initialized with 0. And the values of referenced objects may be underspecified, because an implementation may reuse the same long/void* objects on failure, and thus it's insufficient to specify the initial values of these objects only.

[2022-03-04; Reflector poll]

Set priority to 4 after reflector poll.

Proposed resolution:

This wording is relative to N4901.

  1. Modify 31.5.2.6 [ios.base.storage] as indicated:

    long& iword(int idx);
    

    -3- […]

    -4- […] -5- Returns: On success iarray[idx]. On failure, a n valid lvalue of typelong & with value 0L initialized to 0.
    void*& pword(int idx);
    

    -6- […]

    -7- […] -8- Returns: On success parray[idx]. On failure , a n valid lvalue of typevoid* & with a null pointer value initialized to 0. -9- Remarks: After a subsequent call to pword(int) for the same object, the earlier return value may no longer be valid.

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