Fix unit test: accessing elements in a deque by offsetting a pointer to another element causes undefined behavior.

This commit is contained in:
Gael Guennebaud 2016-02-12 15:31:16 +01:00
parent 9e3f3a2d27
commit b35d1a122e

View File

@ -48,7 +48,6 @@ void check_stddeque_matrix(const MatrixType& m)
VERIFY_IS_APPROX(v[21], y);
v.push_back(x);
VERIFY_IS_APPROX(v[22], x);
VERIFY((size_t)&(v[22]) == (size_t)&(v[21]) + sizeof(MatrixType));
// do a lot of push_back such that the deque gets internally resized
// (with memory reallocation)