aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h b/contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h
index c06892e9e3c7..b350507e32ba 100644
--- a/contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h
+++ b/contrib/llvm-project/libcxx/include/__algorithm/copy_move_common.h
@@ -38,22 +38,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _From, class _To>
struct __can_lower_copy_assignment_to_memmove {
static const bool value =
- // If the types are always bitcastable, it's valid to do a bitwise copy between them.
- __is_always_bitcastable<_From, _To>::value &&
- // Reject conversions that wouldn't be performed by the regular built-in assignment (e.g. between arrays).
- is_trivially_assignable<_To&, const _From&>::value &&
- // `memmove` doesn't accept `volatile` pointers, make sure the optimization SFINAEs away in that case.
- !is_volatile<_From>::value &&
- !is_volatile<_To>::value;
+ // If the types are always bitcastable, it's valid to do a bitwise copy between them.
+ __is_always_bitcastable<_From, _To>::value &&
+ // Reject conversions that wouldn't be performed by the regular built-in assignment (e.g. between arrays).
+ is_trivially_assignable<_To&, const _From&>::value &&
+ // `memmove` doesn't accept `volatile` pointers, make sure the optimization SFINAEs away in that case.
+ !is_volatile<_From>::value && !is_volatile<_To>::value;
};
template <class _From, class _To>
struct __can_lower_move_assignment_to_memmove {
static const bool value =
- __is_always_bitcastable<_From, _To>::value &&
- is_trivially_assignable<_To&, _From&&>::value &&
- !is_volatile<_From>::value &&
- !is_volatile<_To>::value;
+ __is_always_bitcastable<_From, _To>::value && is_trivially_assignable<_To&, _From&&>::value &&
+ !is_volatile<_From>::value && !is_volatile<_To>::value;
};
// `memmove` algorithms implementation.
@@ -95,8 +92,8 @@ struct __can_rewrap<_InIter,
_Sent,
_OutIter,
// Note that sentinels are always copy-constructible.
- __enable_if_t< is_copy_constructible<_InIter>::value &&
- is_copy_constructible<_OutIter>::value > > : true_type {};
+ __enable_if_t< is_copy_constructible<_InIter>::value && is_copy_constructible<_OutIter>::value > >
+ : true_type {};
template <class _Algorithm,
class _InIter,
@@ -108,7 +105,7 @@ __unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
auto __range = std::__unwrap_range(__first, std::move(__last));
auto __result = _Algorithm()(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__out_first));
return std::make_pair(std::__rewrap_range<_Sent>(std::move(__first), std::move(__result.first)),
- std::__rewrap_iter(std::move(__out_first), std::move(__result.second)));
+ std::__rewrap_iter(std::move(__out_first), std::move(__result.second)));
}
template <class _Algorithm,