forked from OSchip/llvm-project
Implement p0337r0. Delete operator= for polymorphic_allocator.
llvm-svn: 273838
This commit is contained in:
parent
9372d8bc61
commit
8b7faa6871
|
@ -176,7 +176,7 @@ public:
|
|||
{}
|
||||
|
||||
polymorphic_allocator &
|
||||
operator=(polymorphic_allocator const &) = default;
|
||||
operator=(polymorphic_allocator const &) = delete;
|
||||
|
||||
// 8.6.3, memory.polymorphic.allocator.mem
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
|
|
@ -24,6 +24,6 @@ namespace ex = std::experimental::pmr;
|
|||
int main()
|
||||
{
|
||||
typedef ex::polymorphic_allocator<void> T;
|
||||
static_assert(std::is_copy_assignable<T>::value, "");
|
||||
static_assert(std::is_move_assignable<T>::value, "");
|
||||
static_assert(!std::is_copy_assignable<T>::value, "");
|
||||
static_assert(!std::is_move_assignable<T>::value, "");
|
||||
}
|
||||
|
|
|
@ -160,26 +160,26 @@ protected:
|
|||
allocator(a)
|
||||
{}
|
||||
|
||||
template <class ...Args>
|
||||
template <class ...Args, class ArgsIDL = detail::TakeNArgs<sizeof...(Args) - 1, Args&&...>>
|
||||
UsesAllocatorTestBase(AllocLastTag, Args&&... args)
|
||||
: args_id(nullptr),
|
||||
constructor_called(UA_AllocLast)
|
||||
: args_id(&makeTypeID<typename ArgsIDL::type>()),
|
||||
constructor_called(UA_AllocLast),
|
||||
allocator(getAllocatorFromPack(
|
||||
typename ArgsIDL::type{},
|
||||
std::forward<Args>(args)...))
|
||||
{
|
||||
typedef typename detail::TakeNArgs<sizeof...(Args) - 1, Args&&...>::type
|
||||
ArgIDL;
|
||||
args_id = &makeTypeID<ArgIDL>();
|
||||
getAllocatorFromPack(ArgIDL{}, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
private:
|
||||
template <class ...LArgs, class ...Args>
|
||||
void getAllocatorFromPack(ArgumentListID<LArgs...>, Args&&... args) {
|
||||
getAllocatorFromPackImp<LArgs const&...>(args...);
|
||||
static CtorAlloc const& getAllocatorFromPack(ArgumentListID<LArgs...>, Args&&... args) {
|
||||
return getAllocatorFromPackImp<LArgs const&...>(args...);
|
||||
}
|
||||
|
||||
template <class ...LArgs>
|
||||
void getAllocatorFromPackImp(typename detail::Identity<LArgs>::type..., CtorAlloc const& alloc) {
|
||||
allocator = alloc;
|
||||
static CtorAlloc const& getAllocatorFromPackImp(
|
||||
typename detail::Identity<LArgs>::type..., CtorAlloc const& alloc) {
|
||||
return alloc;
|
||||
}
|
||||
|
||||
const TypeID* args_id;
|
||||
|
|
Loading…
Reference in New Issue