Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / algorithm / cxx11 / iota.hpp
index b4f0daf..eb32390 100644 (file)
@@ -63,8 +63,8 @@ void iota ( Range &r, T value )
 template <typename OutputIterator, typename T>
 OutputIterator iota_n ( OutputIterator out, T value, std::size_t n )
 {
-    while ( n-- > 0 )
-        *out++ = value++;
+    for ( ; n > 0; --n, ++value )
+        *out++ = value;
 
     return out;
 }