Add hash specializations for __int128_t. Fixes LWG issue 2119
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@266587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2473,6 +2473,22 @@ struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned long long>
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_HAS_NO_INT128
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct _LIBCPP_TYPE_VIS_ONLY hash<__int128_t>
|
||||||
|
: public __scalar_hash<__int128_t>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct _LIBCPP_TYPE_VIS_ONLY hash<__uint128_t>
|
||||||
|
: public __scalar_hash<__uint128_t>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct _LIBCPP_TYPE_VIS_ONLY hash<float>
|
struct _LIBCPP_TYPE_VIS_ONLY hash<float>
|
||||||
: public __scalar_hash<float>
|
: public __scalar_hash<float>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ int main()
|
|||||||
test<int16_t>();
|
test<int16_t>();
|
||||||
test<int32_t>();
|
test<int32_t>();
|
||||||
test<int64_t>();
|
test<int64_t>();
|
||||||
|
|
||||||
test<int_fast8_t>();
|
test<int_fast8_t>();
|
||||||
test<int_fast16_t>();
|
test<int_fast16_t>();
|
||||||
test<int_fast32_t>();
|
test<int_fast32_t>();
|
||||||
@@ -80,12 +80,12 @@ int main()
|
|||||||
|
|
||||||
test<intmax_t>();
|
test<intmax_t>();
|
||||||
test<intptr_t>();
|
test<intptr_t>();
|
||||||
|
|
||||||
test<uint8_t>();
|
test<uint8_t>();
|
||||||
test<uint16_t>();
|
test<uint16_t>();
|
||||||
test<uint32_t>();
|
test<uint32_t>();
|
||||||
test<uint64_t>();
|
test<uint64_t>();
|
||||||
|
|
||||||
test<uint_fast8_t>();
|
test<uint_fast8_t>();
|
||||||
test<uint_fast16_t>();
|
test<uint_fast16_t>();
|
||||||
test<uint_fast32_t>();
|
test<uint_fast32_t>();
|
||||||
@@ -98,4 +98,9 @@ int main()
|
|||||||
|
|
||||||
test<uintmax_t>();
|
test<uintmax_t>();
|
||||||
test<uintptr_t>();
|
test<uintptr_t>();
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_HAS_NO_INT128
|
||||||
|
test<__int128_t>();
|
||||||
|
test<__uint128_t>();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@
|
|||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td>Complete</td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2111">2111</a></td><td>Which <tt>unexpected</tt>/<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2111">2111</a></td><td>Which <tt>unexpected</tt>/<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td></td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Complete</td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td>Complete</td></tr>
|
<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td>Complete</td></tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user