[rtsan] Remove mkfifoat interceptor (#116997)
[llvm-project.git] / libcxx / include / __cxx03 / __algorithm / ranges_fill.h
blob56008ec7304dab9fb7a24f67bd8c8a782c11a8f9
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___ALGORITHM_RANGES_FILL_H
10 #define _LIBCPP___ALGORITHM_RANGES_FILL_H
12 #include <__cxx03/__algorithm/ranges_fill_n.h>
13 #include <__cxx03/__config>
14 #include <__cxx03/__iterator/concepts.h>
15 #include <__cxx03/__ranges/access.h>
16 #include <__cxx03/__ranges/concepts.h>
17 #include <__cxx03/__ranges/dangling.h>
19 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20 # pragma GCC system_header
21 #endif
23 _LIBCPP_PUSH_MACROS
24 #include <__cxx03/__undef_macros>
26 #if _LIBCPP_STD_VER >= 20
28 _LIBCPP_BEGIN_NAMESPACE_STD
30 namespace ranges {
31 namespace __fill {
32 struct __fn {
33 template <class _Type, output_iterator<const _Type&> _Iter, sentinel_for<_Iter> _Sent>
34 _LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(_Iter __first, _Sent __last, const _Type& __value) const {
35 if constexpr (random_access_iterator<_Iter> && sized_sentinel_for<_Sent, _Iter>) {
36 return ranges::fill_n(__first, __last - __first, __value);
37 } else {
38 for (; __first != __last; ++__first)
39 *__first = __value;
40 return __first;
44 template <class _Type, output_range<const _Type&> _Range>
45 _LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range> operator()(_Range&& __range, const _Type& __value) const {
46 return (*this)(ranges::begin(__range), ranges::end(__range), __value);
49 } // namespace __fill
51 inline namespace __cpo {
52 inline constexpr auto fill = __fill::__fn{};
53 } // namespace __cpo
54 } // namespace ranges
56 _LIBCPP_END_NAMESPACE_STD
58 #endif // _LIBCPP_STD_VER >= 20
60 _LIBCPP_POP_MACROS
62 #endif // _LIBCPP___ALGORITHM_RANGES_FILL_H