Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:27:53

0001 /// \file
0002 // Range v3 library
0003 //
0004 //  Copyright Eric Niebler 2013-present
0005 //
0006 //  Use, modification and distribution is subject to the
0007 //  Boost Software License, Version 1.0. (See accompanying
0008 //  file LICENSE_1_0.txt or copy at
0009 //  http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // Project home: https://github.com/ericniebler/range-v3
0012 //
0013 #ifndef RANGES_V3_ALGORITHM_FILL_N_HPP
0014 #define RANGES_V3_ALGORITHM_FILL_N_HPP
0015 
0016 #include <utility>
0017 
0018 #include <range/v3/range_fwd.hpp>
0019 
0020 #include <range/v3/iterator/concepts.hpp>
0021 #include <range/v3/iterator/operations.hpp>
0022 #include <range/v3/range/access.hpp>
0023 #include <range/v3/range/concepts.hpp>
0024 #include <range/v3/range/traits.hpp>
0025 #include <range/v3/utility/static_const.hpp>
0026 
0027 #include <range/v3/detail/prologue.hpp>
0028 
0029 namespace ranges
0030 {
0031     /// \addtogroup group-algorithms
0032     /// @{
0033     RANGES_FUNC_BEGIN(fill_n)
0034 
0035         /// \brief function template \c equal
0036         template(typename O, typename V)(
0037             requires output_iterator<O, V const &>)
0038         constexpr O RANGES_FUNC(fill_n)(O first, iter_difference_t<O> n, V const & val)
0039         {
0040             RANGES_EXPECT(n >= 0);
0041             auto norig = n;
0042             auto b = uncounted(first);
0043             for(; n != 0; ++b, --n)
0044                 *b = val;
0045             return recounted(first, b, norig);
0046         }
0047 
0048     RANGES_FUNC_END(fill_n)
0049 
0050     namespace cpp20
0051     {
0052         using ranges::fill_n;
0053     }
0054     /// @}
0055 } // namespace ranges
0056 
0057 #include <range/v3/detail/epilogue.hpp>
0058 
0059 #endif