Changeset View
Changeset View
Standalone View
Standalone View
test/std/containers/sequences/array/begin.pass.cpp
Show All 34 Lines | int main() | ||||
assert(&*i == c.data()); | assert(&*i == c.data()); | ||||
*i = 5.5; | *i = 5.5; | ||||
assert(c[0] == 5.5); | assert(c[0] == 5.5); | ||||
} | } | ||||
{ | { | ||||
typedef NoDefault T; | typedef NoDefault T; | ||||
typedef std::array<T, 0> C; | typedef std::array<T, 0> C; | ||||
C c = {}; | C c = {}; | ||||
assert(c.begin() == c.end()); | C::iterator ib, ie; | ||||
ib = c.begin(); | |||||
ie = c.end(); | |||||
assert(ib == ie); | |||||
LIBCPP_ASSERT(ib != nullptr); | |||||
ldionne: Comparing the iterator to `nullptr` assumes the iterators to be pointers, which I don't think… | |||||
ldionneUnsubmitted Not Done ReplyInline ActionsThis 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. ldionne: This doesn't compile because you're missing an include of `"test_macros.h"`. Please make a… | |||||
LIBCPP_ASSERT(ie != nullptr); | |||||
} | } | ||||
} | } |
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.