@@ -920,6 +920,22 @@ __deque_base_common<__b>::__throw_out_of_range() const
920
920
_VSTD::__throw_out_of_range (" deque" );
921
921
}
922
922
923
+ template <class _Allocator >
924
+ struct __deque_allow_trivial_relocation {
925
+ typedef _Allocator allocator_type;
926
+ typedef allocator_traits<allocator_type> __alloc_traits;
927
+ typedef typename __alloc_traits::pointer pointer;
928
+ typedef typename __alloc_traits::size_type size_type;
929
+ typedef typename __rebind_alloc_helper<__alloc_traits, pointer>::type __pointer_allocator;
930
+
931
+ typedef integral_constant<bool ,
932
+ is_trivially_relocatable<pointer>::value &&
933
+ is_trivially_relocatable<__pointer_allocator>::value &&
934
+ is_trivially_relocatable<size_type>::value &&
935
+ is_trivially_relocatable<allocator_type>::value
936
+ > type;
937
+ };
938
+
923
939
template <class _Tp , class _Allocator >
924
940
class __deque_base
925
941
: protected __deque_base_common<true >
@@ -1191,7 +1207,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
1191
1207
}
1192
1208
1193
1209
template <class _Tp , class _Allocator /* = allocator<_Tp>*/ >
1194
- class _LIBCPP_TEMPLATE_VIS deque
1210
+ class _LIBCPP_TEMPLATE_VIS _LIBCPP_TRIVIALLY_RELOCATABLE (__deque_allow_trivial_relocation<_Allocator>::type::value) deque
1195
1211
: private __deque_base<_Tp, _Allocator>
1196
1212
{
1197
1213
public:
0 commit comments