forked from boostorg/intrusive
Removed undefined behaviour when iterating backwards when using pointers.
This commit is contained in:
1 parent
5a7892a859
commit
ef8e57ae1b
2 files changed
+7
-7
No files matched your search
@@ -76,11 +76,11 @@ int main()
|
||||
|
||||
//Now test lists
|
||||
List::const_iterator list_it (my_list.cbegin());
|
||||
identifier_t *it_val(&ids[NumElements-1]), *it_rbeg_val(&ids[0]-1);
|
||||
identifier_t *it_val(&ids[NumElements]), *it_rbeg_val(&ids[0]);
|
||||
|
||||
//Test the objects inserted in the base hook list
|
||||
for(; it_val != it_rbeg_val; --it_val, ++list_it)
|
||||
if(&*list_it != &*it_val) return 1;
|
||||
if(&*list_it != &it_val[-1]) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user