diff options
Diffstat (limited to 'include/map')
| -rw-r--r-- | include/map | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/map b/include/map index eb6b8ed05308..adfb4cdb5e9e 100644 --- a/include/map +++ b/include/map @@ -840,6 +840,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"); + class _LIBCPP_TYPE_VIS_ONLY value_compare : public binary_function<value_type, value_type, bool> { @@ -1523,7 +1526,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(const key_type& __h.get_deleter().__first_constructed = true; __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second)); __h.get_deleter().__second_constructed = true; - return _VSTD::move(__h); // explicitly moved for C++03 + return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03 } template <class _Key, class _Tp, class _Compare, class _Allocator> @@ -1696,6 +1699,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"); + class _LIBCPP_TYPE_VIS_ONLY value_compare : public binary_function<value_type, value_type, bool> { |
