Make poisoned hashes SFINAE away the call operator of the hash.
commitf59d23d2284ef9a28134be7782e0acc991680cd5
authorville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jan 2017 15:38:23 +0000 (21 15:38 +0000)
committerville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 21 Jan 2017 15:38:23 +0000 (21 15:38 +0000)
treec4dd133b3f3bc23f7e1a1395c9e1fc10b1c2fde0
parentef14ca404784aaf946c93d8776910a982129b962
Make poisoned hashes SFINAE away the call operator of the hash.
* include/bits/functional_hash.h
(__poison_hash::__enable_hash_call): New.
* include/std/optional (__optional_hash_call_base): New.
(hash<optional<_Tp>>): Derive from the new base,
move the hash function into that base.
* include/std/variant (__variant_hash_call_base_impl): New.
(__variant_hash_call_base): Likewise.
(hash<variant<_Types...>>): Derive from the new base,
move the hash function into that base.
* testsuite/20_util/optional/hash.cc: Add tests for is_callable.
* testsuite/20_util/variant/hash.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244748 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/functional_hash.h
libstdc++-v3/include/std/optional
libstdc++-v3/include/std/variant
libstdc++-v3/testsuite/20_util/optional/hash.cc
libstdc++-v3/testsuite/20_util/variant/hash.cc