Iros
 
Loading...
Searching...
No Matches
copy_n.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace di::container {
9namespace detail {
12 typename SSizeType = meta::IteratorSSizeType<It>>
14 constexpr auto operator()(It first, meta::TypeIdentity<SSizeType> n, Out output) const -> InOutResult<It, Out> {
15 // FIXME: use vectorized byte copy (::memcpy_forward) when provided contiguous
16 // iterators to trivially copyable types.
17 for (SSizeType i = 0; i < n; ++i, ++first, ++output) {
18 *output = *first;
19 }
20 return { util::move(first), util::move(output) };
21 }
22 };
23}
24
25constexpr inline auto copy_n = detail::CopyNFunction {};
26}
27
28namespace di {
30}
Definition indirectly_copyable.h:9
Definition input_iterator.h:9
Definition weakly_incrementable.h:10
Definition sequence.h:13
Definition sequence.h:12
constexpr auto copy_n
Definition copy_n.h:25
Type< TypeConstant< T > > TypeIdentity
This is a helper template to prevent C++ from deducing the type of template argument.
Definition core.h:32
decltype(container::iterator_ssize_type(types::in_place_type< meta::RemoveCVRef< T > >)) IteratorSSizeType
Definition iterator_ssize_type.h:8
Definition zstring_parser.h:9
Definition in_out_result.h:8