Iros
 
Loading...
Searching...
No Matches
fill.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace di::container {
9namespace detail {
10 struct FillFunction {
11 template<typename T, concepts::OutputIterator<T const&> Out, concepts::SentinelFor<Out> Sent>
12 constexpr auto operator()(Out first, Sent last, T const& value) const -> Out {
13 for (; first != last; ++first) {
14 *first = value;
15 }
16 return first;
17 }
18
19 template<typename T, concepts::OutputContainer<T const&> Out>
20 constexpr auto operator()(Out&& container, T const& value) const -> meta::BorrowedIterator<Out> {
21 return (*this)(container::begin(container), container::end(container), value);
22 }
23 };
24}
25
26constexpr inline auto fill = detail::FillFunction {};
27}
28
29namespace di {
30using container::fill;
31}
Definition sequence.h:13
Definition sequence.h:12
constexpr auto fill
Definition fill.h:26
constexpr auto end
Definition end.h:47
constexpr auto begin
Definition begin.h:44
Conditional< concepts::BorrowedContainer< Con >, ContainerIterator< Con >, container::Dangling > BorrowedIterator
Definition borrowed_iterator.h:11
Definition zstring_parser.h:9
constexpr auto operator()(Out first, Sent last, T const &value) const -> Out
Definition fill.h:12
constexpr auto operator()(Out &&container, T const &value) const -> meta::BorrowedIterator< Out >
Definition fill.h:20