equal
deleted
inserted
replaced
99 _next(0) {} |
99 _next(0) {} |
100 |
100 |
101 template <typename T, bool parallel> |
101 template <typename T, bool parallel> |
102 inline bool ZArrayIteratorImpl<T, parallel>::next(T* elem) { |
102 inline bool ZArrayIteratorImpl<T, parallel>::next(T* elem) { |
103 if (parallel) { |
103 if (parallel) { |
104 const size_t next = Atomic::add(1u, &_next) - 1u; |
104 const size_t next = Atomic::add(&_next, 1u) - 1u; |
105 if (next < _array->size()) { |
105 if (next < _array->size()) { |
106 *elem = _array->at(next); |
106 *elem = _array->at(next); |
107 return true; |
107 return true; |
108 } |
108 } |
109 } else { |
109 } else { |