A RetroSearch Logo

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

Search Query:

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

Insert iterator constructors should use addressof()

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

2324. Insert iterator constructors should use addressof()

Section: 24.5.2.2.2 [back.insert.iter.ops], 24.5.2.3.2 [front.insert.iter.ops], 24.5.2.4.2 [insert.iter.ops] Status: C++14 Submitter: Stephan T. Lavavej Opened: 2013-09-21 Last modified: 2021-06-06

Priority: 0

View all other issues in [back.insert.iter.ops].

View all issues with C++14 status.

Discussion:

[back.insert.iter.cons]/1, [front.insert.iter.cons]/1, and [insert.iter.cons]/1 say "Initializes container with &x", which doesn't defend against containers overloading operator&(). Containers are now required to have such defenses for their elements, so we may as well be consistent here.

[Issaquah 2014-02-11: Move to Immediate]

Proposed resolution:

This wording is relative to N3691.

  1. Edit [back.insert.iter.cons]/1 as indicated:

    explicit back_insert_iterator(Container& x);
    

    -1- Effects: Initializes container with &x std::addressof(x).

  2. Edit [front.insert.iter.cons]/1 as indicated:

    explicit front_insert_iterator(Container& x);
    

    -1- Effects: Initializes container with &x std::addressof(x).

  3. Edit [insert.iter.cons]/1 as indicated:

    insert_iterator(Container& x, typename Container::iterator i);
    

    -1- Effects: Initializes container with &x std::addressof(x) and iter with i.


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