This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++17 status.
vector::data() should useaddressofSection: 23.3.13.4[vector.data]Status:C++17Submitter: Marshall ClowOpened: 2016-02-29Last modified: 2017-07-30
Priority:0
View all otherissues in [vector.data].
View all issues withC++17 status.
Discussion:
In 23.3.13.4[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()).
Proposed resolution:
This wording is relative to N4582.
Change 23.3.13.4[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())