The standard section array.zero requires the return value of begin() and end() methods of a zero-sized array to be unique. Eric Fiselier clarifies: "That unique value cannot be null, and must be properly aligned". This patch adds checks for the first part of this clarification: unique value returned by these methods cannot be null.
Diff Detail
Diff Detail
Event Timeline
test/std/containers/sequences/array/begin.pass.cpp | ||
---|---|---|
49 | Comparing the iterator to nullptr assumes the iterators to be pointers, which I don't think is required. They're only required to be contiguous iterators. |
Comment Actions
In libc++ these array iterators declared as follows:
typedef value_type* iterator; typedef const value_type* const_iterator;
The asserts changed to LIBCPP_ASSERTs.
Comment Actions
Committed as r348509.
test/std/containers/sequences/array/begin.pass.cpp | ||
---|---|---|
49 | This doesn't compile because you're missing an include of "test_macros.h". Please make a habit of running the tests before submitting a review. |
Comment Actions
Yes, but that's just true for libc++. Other library maintainers use these tests, too.
(and frankly, I screwed up when I implemented <array>. Those iterators should not be pointers)
Comparing the iterator to nullptr assumes the iterators to be pointers, which I don't think is required. They're only required to be contiguous iterators.