noexcept(declval<const _Hash&>()(declval<const _Key&>()))>
{ };
+ struct _Identity
+ {
+ template<typename _Tp>
+ _Tp&&
+ operator()(_Tp&& __x) const
+ { return std::forward<_Tp>(__x); }
+ };
+
+ struct _Select1st
+ {
+ template<typename _Tp>
+ auto
+ operator()(_Tp&& __x) const
+ -> decltype(std::get<0>(std::forward<_Tp>(__x)))
+ { return std::get<0>(std::forward<_Tp>(__x)); }
+ };
+
// Auxiliary types used for all instantiations of _Hashtable nodes
// and iterators.
template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
typename _H1, typename _H2, typename _Hash,
typename _RehashPolicy, typename _Traits>
- struct _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ struct _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, false>
{
- using mapped_type = typename _Pair::second_type;
+ using mapped_type = typename std::tuple_element<1, _Pair>::type;
};
/// Partial specialization, __unique_keys set to true.
template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
typename _H1, typename _H2, typename _Hash,
typename _RehashPolicy, typename _Traits>
- struct _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ struct _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>
{
private:
using __hashtable_base = __detail::_Hashtable_base<_Key, _Pair,
- std::_Select1st<_Pair>,
+ _Select1st,
_Equal, _H1, _H2, _Hash,
_Traits>;
using __hashtable = _Hashtable<_Key, _Pair, _Alloc,
- std::_Select1st<_Pair>, _Equal,
+ _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits>;
using __hash_code = typename __hashtable_base::__hash_code;
public:
using key_type = typename __hashtable_base::key_type;
using iterator = typename __hashtable_base::iterator;
- using mapped_type = typename _Pair::second_type;
+ using mapped_type = typename std::tuple_element<1, _Pair>::type;
mapped_type&
operator[](const key_type& __k);
template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
typename _H1, typename _H2, typename _Hash,
typename _RehashPolicy, typename _Traits>
- typename _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ typename _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>
::mapped_type&
- _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
operator[](const key_type& __k)
{
template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
typename _H1, typename _H2, typename _Hash,
typename _RehashPolicy, typename _Traits>
- typename _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ typename _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>
::mapped_type&
- _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
operator[](key_type&& __k)
{
template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
typename _H1, typename _H2, typename _Hash,
typename _RehashPolicy, typename _Traits>
- typename _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ typename _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>
::mapped_type&
- _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
at(const key_type& __k)
{
template<typename _Key, typename _Pair, typename _Alloc, typename _Equal,
typename _H1, typename _H2, typename _Hash,
typename _RehashPolicy, typename _Traits>
- const typename _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>,
- _Equal,
- _H1, _H2, _Hash, _RehashPolicy, _Traits, true>
- ::mapped_type&
- _Map_base<_Key, _Pair, _Alloc, std::_Select1st<_Pair>, _Equal,
+ const typename _Map_base<_Key, _Pair, _Alloc, _Select1st,
+ _Equal, _H1, _H2, _Hash, _RehashPolicy,
+ _Traits, true>::mapped_type&
+ _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal,
_H1, _H2, _Hash, _RehashPolicy, _Traits, true>::
at(const key_type& __k) const
{
iterator>::type;
using __iconv_type = typename std::conditional<__unique_keys::value,
- std::_Select1st<__ireturn_type>,
- std::_Identity<__ireturn_type>
+ _Select1st, _Identity
>::type;
private:
using _EqualEBO = _Hashtable_ebo_helper<0, _Equal>;