[RISCV] Add MIPS P8700 processor (#119882)
[llvm-project.git] / libcxx / include / __cxx03 / __algorithm / ranges_fill_n.h
blob07f04c293451fed46356e3c631c86785e3cca40c
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___CXX03___ALGORITHM_RANGES_FILL_N_H
10 #define _LIBCPP___CXX03___ALGORITHM_RANGES_FILL_N_H
12 #include <__cxx03/__config>
13 #include <__cxx03/__iterator/concepts.h>
14 #include <__cxx03/__iterator/incrementable_traits.h>
16 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17 # pragma GCC system_header
18 #endif
20 _LIBCPP_PUSH_MACROS
21 #include <__cxx03/__undef_macros>
23 #if _LIBCPP_STD_VER >= 20
25 _LIBCPP_BEGIN_NAMESPACE_STD
27 namespace ranges {
28 namespace __fill_n {
29 struct __fn {
30 template <class _Type, output_iterator<const _Type&> _Iter>
31 _LIBCPP_HIDE_FROM_ABI constexpr _Iter
32 operator()(_Iter __first, iter_difference_t<_Iter> __n, const _Type& __value) const {
33 for (; __n != 0; --__n) {
34 *__first = __value;
35 ++__first;
37 return __first;
40 } // namespace __fill_n
42 inline namespace __cpo {
43 inline constexpr auto fill_n = __fill_n::__fn{};
44 } // namespace __cpo
45 } // namespace ranges
47 _LIBCPP_END_NAMESPACE_STD
49 #endif // _LIBCPP_STD_VER >= 20
51 _LIBCPP_POP_MACROS
53 #endif // _LIBCPP___CXX03___ALGORITHM_RANGES_FILL_N_H