Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
util
algorithms
UninitializedTransfer.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_UTIL_ALGORITHMS_UNINITIALIZEDTRANSFER_H_
36
#define _BLAZE_UTIL_ALGORITHMS_UNINITIALIZEDTRANSFER_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <algorithm>
44
#include <iterator>
45
#include <
blaze/util/algorithms/UninitializedMove.h
>
46
#include <
blaze/util/typetraits/IsAssignable.h
>
47
48
49
namespace
blaze {
50
51
//=================================================================================================
52
//
53
// UNINITIALIZED_TRANSFER ALGORITHMS
54
//
55
//=================================================================================================
56
57
//*************************************************************************************************
71
template
<
typename
InputIt
72
,
typename
ForwardIt >
73
ForwardIt
uninitialized_transfer
( InputIt first, InputIt last, ForwardIt dest )
74
{
75
using
T =
typename
std::iterator_traits<InputIt>::value_type;
76
77
if
(
IsNothrowMoveAssignable_v<T>
) {
78
return
blaze::uninitialized_move
( first, last, dest );
79
}
80
else
{
81
return
std::uninitialized_copy( first, last, dest );
82
}
83
}
84
//*************************************************************************************************
85
86
87
//*************************************************************************************************
101
template
<
typename
InputIt
102
,
typename
ForwardIt >
103
ForwardIt
uninitialized_transfer_n
( InputIt first,
size_t
n, ForwardIt dest )
104
{
105
using
T =
typename
std::iterator_traits<InputIt>::value_type;
106
107
if
(
IsNothrowMoveAssignable_v<T>
) {
108
return
blaze::uninitialized_move_n
( first, n, dest );
109
}
110
else
{
111
return
std::uninitialized_copy_n( first, n, dest );
112
}
113
}
114
//*************************************************************************************************
115
116
}
// namespace blaze
117
118
#endif
IsAssignable.h
Header file for the IsAssignable type trait.
UninitializedMove.h
Header file for the generic uninitialized_move algorithm.
blaze::uninitialized_transfer_n
ForwardIt uninitialized_transfer_n(InputIt first, size_t n, ForwardIt dest)
Transfers the elements from the given source range to the uninitialized destination range.
Definition
UninitializedTransfer.h:103
blaze::uninitialized_move
ForwardIt uninitialized_move(InputIt first, InputIt last, ForwardIt dest)
Move the elements from the given source range to the uninitialized destination range.
Definition
UninitializedMove.h:72
blaze::uninitialized_move_n
ForwardIt uninitialized_move_n(InputIt first, size_t n, ForwardIt dest)
Move the elements from the given source range to the uninitialized destination range.
Definition
UninitializedMove.h:107
blaze::uninitialized_transfer
ForwardIt uninitialized_transfer(InputIt first, InputIt last, ForwardIt dest)
Transfers the elements from the given source range to the uninitialized destination range.
Definition
UninitializedTransfer.h:73
blaze::IsNothrowMoveAssignable_v
constexpr bool IsNothrowMoveAssignable_v
Auxiliary variable template for the IsNothrowMoveAssignable type trait.
Definition
IsAssignable.h:334
Generated by
1.18.0