Make poisoned hashes SFINAE away the call operator of the hash.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Sat, 21 Jan 2017 15:38:23 +0000 (17:38 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Sat, 21 Jan 2017 15:38:23 +0000 (17:38 +0200)
commit509912a611f9e86883cd1f3c1751e4a1b3cb7abf
treec4dd133b3f3bc23f7e1a1395c9e1fc10b1c2fde0
parentc31d5fcecf100a3012fae0b99639022a992f28f0
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.

From-SVN: r244748
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