Title
vector::data() should use addressof
Status
c++17
Section
[vector.data]
Submitter
Marshall Clow

Created on 2016-02-29.00:00:00 last changed 89 months ago

Messages

Date: 2016-04-07.20:14:30

Proposed resolution:

This wording is relative to N4582.

  1. Change [vector.data] p1 as indicated:

    T* data() noexcept;
    const T* data() const noexcept;
    

    -1- Returns: A pointer such that [data(), data() + size()) is a valid range. For a non-empty vector, data() == addressof(&front()).

Date: 2016-02-29.00:00:00

In [vector.data], we have:

Returns: A pointer such that [data(),data() + size()) is a valid range. For a non-empty vector, data() == &front().

This should be:

Returns: A pointer such that [data(),data() + size()) is a valid range. For a non-empty vector, data() == addressof(front()).

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2016-06-28 12:50:44adminsetstatus: ready -> wp
2016-04-16 04:21:53adminsetstatus: new -> ready
2016-04-07 20:14:30adminsetmessages: + msg8029
2016-02-29 00:00:00admincreate