diff --git a/include/boost/lockfree/stack.hpp b/include/boost/lockfree/stack.hpp index 6db986c..455a772 100644 --- a/include/boost/lockfree/stack.hpp +++ b/include/boost/lockfree/stack.hpp @@ -243,6 +243,11 @@ class stack template tuple prepare_node_list(ConstIterator begin, ConstIterator end, ConstIterator & ret) { + if (begin == end) { + ret = begin; + return make_tuple(NULL, NULL); + } + ConstIterator it = begin; node * end_node = pool.template construct(*it++); if (end_node == NULL) {