Skip to content
Snippets Groups Projects
Commit 8a9f01c6 authored by Martin Nolte's avatar Martin Nolte
Browse files

[bugfix] initialize pointer to list in `ArrayList` iterators

On default construction, the pointer in `ArrayListIterator` and
`ArrayListConstIterator` was uninitialized. This caused an assertion to fail
upon comparing them, but the code otherwise worked fine. This patch correctly
initializes the pointer to `nullptr` to avoid unspecified behavior.
parent 22d3a9df
No related branches found
No related tags found
No related merge requests found
......@@ -346,7 +346,7 @@ namespace Dune
inline ArrayListIterator<T,N,A>& operator=(const ArrayListIterator<T,N,A>& other);
//! Standard constructor
inline ArrayListIterator() : position_(0)
inline ArrayListIterator() : position_(0), list_(nullptr)
{}
private:
......@@ -441,7 +441,7 @@ namespace Dune
inline const ConstArrayListIterator<T,N,A>& operator=(const ConstArrayListIterator<T,N,A>& other);
inline ConstArrayListIterator() : position_(0)
inline ConstArrayListIterator() : position_(0), list_(nullptr)
{}
inline ConstArrayListIterator(const ArrayListIterator<T,N,A>& other);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment