diff --git a/containers.cpp b/containers.cpp index de66891..474cc26 100644 --- a/containers.cpp +++ b/containers.cpp @@ -79,7 +79,8 @@ packToken TokenList::default_constructor(TokenMap scope) { packToken* TokenList::ListIterator::next() { if (i < list->size()) { - return &list->at(i++); + TokenList_t::size_type idx = TokenList_t::size_type(i++); + return &list->at(idx); } else { i = 0; return NULL; diff --git a/containers.h b/containers.h index 7b2adf8..499028b 100644 --- a/containers.h +++ b/containers.h @@ -166,7 +166,8 @@ struct TokenList : public Container, public Iterable { if (list().size() <= idx) { throw std::out_of_range("List index out of range!"); } - return list()[idx]; + TokenList_t::size_type i = TokenList_t::size_type(idx); + return list()[i]; } void push(packToken val) const { list().push_back(val); }