Skip to content

Commit

Permalink
Fix #249: Change <hash_map> to consistently use int = 0 SFINAE (#328)
Browse files Browse the repository at this point in the history
Permanently work around DevCom-848104 by simplifying hash_meow::value_type. This is what unordered_meow::value_type already does, which is why that can already use int = 0 SFINAE.
  • Loading branch information
jpjjulie authored and StephanTLavavej committed Dec 7, 2019
1 parent ad5b806 commit 8f94319
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stl/inc/hash_map
Expand Up @@ -121,7 +121,7 @@ namespace stdext {
using referent_type = _Ty;
using key_compare = _Tr;
using value_compare = typename _Mybase::_Value_compare;
using value_type = typename _Mybase::value_type;
using value_type = pair<const _Kty, _Ty>;
using allocator_type = typename _Mybase::allocator_type;
using size_type = typename _Mybase::size_type;
using difference_type = typename _Mybase::difference_type;
Expand Down Expand Up @@ -190,12 +190,12 @@ namespace stdext {

using _Mybase::insert;

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>> // TRANSITION, GH-249
template <class _Valty, enable_if_t<is_constructible_v<value_type, _Valty>, int> = 0>
pair<iterator, bool> insert(_Valty&& _Val) {
return this->emplace(_STD forward<_Valty>(_Val));
}

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>> // TRANSITION, GH-249
template <class _Valty, enable_if_t<is_constructible_v<value_type, _Valty>, int> = 0>
iterator insert(const_iterator _Where, _Valty&& _Val) {
return this->emplace_hint(_Where, _STD forward<_Valty>(_Val));
}
Expand Down Expand Up @@ -311,7 +311,7 @@ namespace stdext {
using referent_type = _Ty; // old name, magically gone
using key_compare = _Tr;
using value_compare = typename _Mybase::_Value_compare;
using value_type = typename _Mybase::value_type;
using value_type = pair<const _Kty, _Ty>;
using allocator_type = typename _Mybase::allocator_type;
using size_type = typename _Mybase::size_type;
using difference_type = typename _Mybase::difference_type;
Expand Down Expand Up @@ -373,12 +373,12 @@ namespace stdext {

using _Mybase::insert;

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>> // TRANSITION, GH-249
template <class _Valty, enable_if_t<is_constructible_v<value_type, _Valty>, int> = 0>
iterator insert(_Valty&& _Val) {
return this->emplace(_STD forward<_Valty>(_Val));
}

template <class _Valty, class = enable_if_t<is_constructible_v<value_type, _Valty>>> // TRANSITION, GH-249
template <class _Valty, enable_if_t<is_constructible_v<value_type, _Valty>, int> = 0>
iterator insert(const_iterator _Where, _Valty&& _Val) {
return this->emplace_hint(_Where, _STD forward<_Valty>(_Val));
}
Expand Down

0 comments on commit 8f94319

Please sign in to comment.