Line data Source code
1 : // Author(s): Wieger Wesselink 2 : // Copyright: see the accompanying file COPYING or copy at 3 : // https://github.com/mCRL2org/mCRL2/blob/master/COPYING 4 : // 5 : // Distributed under the Boost Software License, Version 1.0. 6 : // (See accompanying file LICENSE_1_0.txt or copy at 7 : // http://www.boost.org/LICENSE_1_0.txt) 8 : // 9 : /// \file mcrl2/utilities/detail/iota.h 10 : /// \brief The iota function. 11 : 12 : #ifndef MCRL2_UTILITIES_DETAIL_IOTA_H 13 : #define MCRL2_UTILITIES_DETAIL_IOTA_H 14 : 15 : namespace mcrl2 16 : { 17 : 18 : namespace utilities 19 : { 20 : 21 : namespace detail 22 : { 23 : 24 : /// \brief Generates the sequence value, value + 1, ... and writes it to the sequence [first, last) 25 : /// \param first Start of a sequence 26 : /// \param last End of a sequence 27 : /// \param value A value 28 : template <class Iter, class T> 29 1 : void iota(Iter first, Iter last, T value) 30 : { 31 23 : while (first != last) 32 : { 33 22 : *first++ = value++; 34 : } 35 1 : } 36 : 37 : } // namespace detail 38 : 39 : } // namespace utilities 40 : 41 : } // namespace mcrl2 42 : 43 : #endif // MCRL2_UTILITIES_DETAIL_IOTA_H