diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2015-11-26 01:24:04 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2015-11-26 01:24:04 +0000 |
| commit | 94f89aeec5eb6a720f734b84523451d92206c0bb (patch) | |
| tree | fb38a79ecab4d5d03195d749bc89bc3420849ba7 /libcxx/include/forward_list | |
| parent | bcd150362aff56aafdecb5545b36a50c00c63cd5 (diff) | |
| download | bcm5719-llvm-94f89aeec5eb6a720f734b84523451d92206c0bb.tar.gz bcm5719-llvm-94f89aeec5eb6a720f734b84523451d92206c0bb.zip | |
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.
llvm-svn: 254119
Diffstat (limited to 'libcxx/include/forward_list')
| -rw-r--r-- | libcxx/include/forward_list | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list index 8a87fc5e1f2..adbc32cf861 100644 --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -537,6 +537,9 @@ public: typedef _Tp value_type; typedef _Alloc allocator_type; + static_assert((is_same<typename allocator_type::value_type, value_type>::value), + "Allocator::value_type must be same type as value_type"); + typedef value_type& reference; typedef const value_type& const_reference; typedef typename allocator_traits<allocator_type>::pointer pointer; |

