Movatterモバイル変換


[0]ホーム

URL:



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

69. Must elements of a vector be contiguous?

Section: 23.3.13[vector]Status:TC1Submitter: Andrew KoenigOpened: 1998-07-29Last modified: 2016-01-28

Priority:Not Prioritized

View all otherissues in [vector].

View all issues withTC1 status.

Discussion:

The issue is this: Must the elements of a vector be in contiguous memory?

(Please note that this is entirely separate from the question ofwhether a vector iterator is required to be a pointer; the answer tothat question is clearly "no," as it would rule outdebugging implementations)

Proposed resolution:

Add the following text to the end of 23.3.13[vector],paragraph 1.

The elements of a vector are stored contiguously, meaning that if v is avector<T, Allocator> where T is some type other thanbool, then it obeys the identity&v[n] == &v[0] + n for all0 <= n < v.size().

Rationale:

The LWG feels that as a practical matter the answer is clearly"yes". There was considerable discussion as to the best wayto express the concept of "contiguous", which is notdirectly defined in the standard. Discussion included:


[8]ページ先頭

©2009-2026 Movatter.jp