Add static_assert to set/multiset/map/multimap/forward_list/deque that the allocator's value_type match the container's value_type. vector/unordered/list/string already do this. Add tests for all the containers to verify this.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@254119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -409,6 +409,9 @@ public:
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
||||
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
|
||||
"Allocator::value_type must be same type as value_type");
|
||||
|
||||
private:
|
||||
typedef __tree<value_type, value_compare, allocator_type> __base;
|
||||
typedef allocator_traits<allocator_type> __alloc_traits;
|
||||
@@ -819,6 +822,9 @@ public:
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
||||
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
|
||||
"Allocator::value_type must be same type as value_type");
|
||||
|
||||
private:
|
||||
typedef __tree<value_type, value_compare, allocator_type> __base;
|
||||
typedef allocator_traits<allocator_type> __alloc_traits;
|
||||
|
||||
Reference in New Issue
Block a user